code:function cnt_mysql_query($sql=FALSE) { static $queries = 0; if (!$sql) return $queries; $queries ++; return mysql_query($sql); }