Create a wrapper for your *_query() function, i.e.;
$qCount = 0;
function db_query($qstring) {
global $qCount;
$qCount++;
return @mysql_db_query("dbname", $qstring);
}
And use this instead of mysql_query() or whatever. Then the $qCount will show you how many queries you have used. 🙂