Finding the source of query in General Log
We use a similar query in our different code b开发者_StackOverflow社区ase modules and at times it gets difficult to check in General/Slow Query Log to find out the page where it got executed.
Is there anyway to pass some info to server while executing query?
You can put a comment in your queries:
$sql = "-- Called from myfile.php:
SELECT * from table;";
$res = mysql_query($sql);
The comment will be considered part of the statement and logged along with the query itself.
精彩评论