southbeach
Programmer
I am trying to track all queries ever ran in my application. Since all queries are executed via UDF named DoQuery($sql) (where $sql is the MySQL command construct), this is a very simple change - Except, I can't get it to work.
Here is what I have:
The queries table consists of the following:
id int(9) auto_increment primary nonull
date timestamp on update current_time_stamp nonull
query text nonull
user varchar(10) nonull
I know that the $sql variable will have quotes within as part of the string value, but notice I am using mysql_escape_string().
It just does not get much simpler than this. What am I missing?
Here is what I have:
Code:
$trackthis = 'INSERT INTO queries VALUES (`query`,`user`) VALUES (' . mysql_escape_string($sql) . ',"' . $_SESSION['who_user'] . '")';
The queries table consists of the following:
id int(9) auto_increment primary nonull
date timestamp on update current_time_stamp nonull
query text nonull
user varchar(10) nonull
I know that the $sql variable will have quotes within as part of the string value, but notice I am using mysql_escape_string().
It just does not get much simpler than this. What am I missing?