well to do the number of sql queries, you have to replace the SQL_query function with your own so it performs the query as well as incrementing a static variable then when you want to display the number of queires make it show it when the function takes no arguements.
I made that sound a lot more complicated than it is lol