again, there are 2 ways for u ^__^ 1. if you are using a db library. Check manual for function to list all queries. 2. write your own function to save all sql content any time you query
You can collect all of your queries into a global variable and at the end of your file you could list the content of this variable. //............ function db_query($sql) { global $my_queries; $my_queries[] = $sql; mysql_query($sql); } //somewhere at the end global $my_queries; print_r($my_queries); PHP:
Alternatively, you can also use the built in MySQL logger: http://dev.mysql.com/doc/refman/5.0/en/query-log.html