views:

42

answers:

3

i'm trying to track down a bug that's deleting rows in a mysql table.

for the life of me i can't track it down in my php code, so i'd like to work backwards by finding the actual mysql query that's removing the rows.

i logged in to phpmyadmin, but can't find a way to view the history of past sql operations.

is there a way to view them in phpmyadmin?

+3  A: 

I don't think phpmyadmin lets you do that, but I'd like to hear I'm wrong.

On the other end you can enable query logging in mysql http://dev.mysql.com/doc/refman/5.0/en/query-log.html

baol
thanks, just enabled the query-logging ... should help.
chris1979
thanks northpole :)
baol
A: 

I may be wrong, but I believe I've seen a list of previous SQL queries in the session file for phpmyadmin sessions

Mark Baker
thanks mark, i'll look through the session file now ...
chris1979
Apologies... I'd misread your question: the list in session is the list of previous statements issued through phpmyadmin, so it doesn't contain any SQL statements issued by your own PHP scripts, so probably not that helpful.
Mark Baker
A: 

ok, so i actually stumbled across the answer.

phpmyadmin does offer a brief history. if you click on the 'sql' icon just underneath the 'phpmyadmin' logo, it'll open a new window. in the new window, just click on the 'history' tab.

that'll give you the last twenty or so sql operations.

chris1979