How do I store recent queries in a database?? I know how to find recent searches which is inserted/modified the database but if it isn't inserted/modified then how do I find recent queries???
+1
A:
You will want to enable MySQL's General Query Log. Taken directly from the site:
The general query log is a general record of what mysqld is doing. The server writes information to this log when clients connect or disconnect, and it logs each SQL statement received from clients.
Steve Finkelstein
2010-06-10 02:23:32
I think you are referring to the log file which is created by mysql. but what I want is say I do have a site which is a search site. I want to show on my website what recent queries people made with a "Recent search" heading....
mathew
2010-06-10 02:32:57
You'll need to store/cache all incoming queries to some form of persistent storage that you can query later. Whether that's your current database, file, etc. What's wrong with simply creating a table of recent searches where stashing them in there?
Steve Finkelstein
2010-06-10 02:43:04
ok let me try I will revert back If I struck in the middle...Thanks
mathew
2010-06-10 04:23:25