Yes there is. If you send a query using php the query is a string that can be echoed. Furthermore you could save statistics in a sql-table.
$query = "SELECT * FROM sql_table";
echo "Query string = ".$query;
Or save count in a table. This is just to give you an idea.
//connect to MySQL
//run query
$query_one = "SELECT * FROM sql_table";
$result = mysql_query($query_one);
while($row = mysql_fetch_array($result))
{
//do something with the result from $query_one.
}
$temp = mysql_affected_rows();
$query = "INSERT INTO query_table (query, rows) VALUES (".$query_one.", ".$temp.")"; //can't say if this syntax is correct right now. :o
mysql_query($query);
//close connection to MySQL