Need help with MySQL as it\'s not really my forte. So any help is appreciated.
I have issues on my site where UPDATE
or INSERT
were done wi
You don't exactly have to log it into a database.
Use file_put_contents with FILE_APPEND and store it in a text file using the tab delimiters or as a csv. That way you can easily import to a database when you need to or view the file in Excel or Numbers (in Mac) whenever you need them.
You can log the text file by dates, ie sql_queries_2012-05-24, and just store it in a folder. Text files shouldn't take as more space than storing it in a database. A simple 'if else' statement, with php date functions, should get the logging sorted by dates.
Using text files is certainly more cost-effective in resources than storing them in a database. Moreover, using php fgetcsv to index and INSERT from text files is much faster than using mysql UPDATE.
If you don't want some value missing on the database, can you use constraint to enforce that?