Is it possible to know which PHP script is executing a certain mysql query?
I’m using a prebuilt system which has a bunch of files and I’m seeing one query I want to investigate but no idea where to start looking.
Thanks,
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Try searching for non-variable parts of the query in the source files directly (e.g. using your IDE’s search function, or using
grep -r 'some part of the query').If you can’t find it, try tracing function calls with xdebug. This will log all PHP function calls, and it will be easy to find which file did mysql_query(the query).
(Set the ini setting
xdebug.collect_paramsto3to get the parameter values in the log file.)