how would I count the number of sql queries executed on one page load?
I have a similar script to time taken for page to be generated, but not for how many queries h
SMF does its query counting by having its own custom query function:
function db_query($db_string, $file, $line)
{
global $db_cache, $db_count, $db_connection, $db_show_debug, $modSettings;
// One more query....
$db_count = !isset($db_count) ? 1 : $db_count + 1;
...
The simplest way to achieve what you're trying to do would be to do the same; make a wrapper for mysql_query and use that instead of mysql_query.