After that SQL statement $String will contain the name of the active database for the specified profile, "test" in the example. It's not good to hard-code the database as it will change if/when you perform a new walk.
<$mydb=$String>
<sql db=$mydb "select ... from querylog where id>=$mydate">
<$mydb=$String>
<sql db=$mydb "select ... from querylog where id>=$mydate">