Can I monitor which file executes the SQL statement? I took over the maintenance for the project, but the developer was not me, but found that the website may have a backdoor.
Data is often modified.
However, one file and one file cannot be found.
So I want to monitor which file to perform the operation records and analyze them ..
Is there any way?
Reply to discussion (solution)
Does your project use a database class?
Does your project use a database class?
Is conn. php called During database operations?
Does your project use a database class?
The include folder contains db_mysql.class.php.
Check whether mysql_query exists in files other than db_mysql.class.php.
If yes, it is all the places to be checked.
In the db_mysql.class.php file, the Chinese method contains the characters query, execute, insert, update, and fetch.
Join
file_put_contents('log.txt', print_r(debug_backtrace(), 1), FILE_APPEND);
You can see from the log.txt file where the SQL command is executed.
Just try again later.
Check whether mysql_query exists in files other than db_mysql.class.php.
If yes, it is all the places to be checked.
In the db_mysql.class.php file, the Chinese method contains the characters query, execute, insert, update, and fetch.
Join
file_put_contents('log.txt', print_r(debug_backtrace(), 1), FILE_APPEND);
You can see from the log.txt file where the SQL command is executed.
Thank you. However, I found that some php files also use some SQL statements. Can I directly write it in config. php?
Check whether mysql_query exists in files other than db_mysql.class.php.
If yes, it is all the places to be checked.
In the db_mysql.class.php file, the Chinese method contains the characters query, execute, insert, update, and fetch.
Join
file_put_contents('log.txt', print_r(debug_backtrace(), 1), FILE_APPEND);
You can see from the log.txt file where the SQL command is executed.
Array
(
[0] => Array
(
[File] =>/www/web/zlhk/public_html/include/conn. php
[Line] => 3
[Function] => include
)
[1] => Array
(
[File] =>/www/web/zlhk/public_html/madmin45/users. php
[Line] => 8
[Args] => Array
(
[0] =>/www/web/zlhk/public_html/include/conn. php
)
[Function] => include
)
)
Array
All similar data
You didn't do what I said!