Get Full MySQL Query String on Insert or Update

后端 未结 8 1012
旧巷少年郎
旧巷少年郎 2020-12-13 10:16

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

相关标签:
8条回答
  • 2020-12-13 11:08

    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.

    0 讨论(0)
  • 2020-12-13 11:08

    If you don't want some value missing on the database, can you use constraint to enforce that?

    0 讨论(0)
提交回复
热议问题