MySQL: Logging SQL Statements for Debugging PHP Apps

  • Thread starter Thread starter rdx
  • Start date Start date
  • Tags Tags
    Mysql Sql
AI Thread Summary
The discussion centers on the challenge of logging SQL statements into a MySQL table for debugging PHP applications. The main issue arises from MySQL interpreting the SQL statements, leading to syntax errors during insertion. A suggested solution involves addressing the presence of apostrophes in the SQL statements by doubling them (replacing ' with ''). Participants express interest in exploring this workaround to effectively log the SQL data without encountering errors.
rdx
Messages
50
Reaction score
0
Goal: I seek to log the SQL statements into a MySQL table, with the time they were executed as an aid to debugging problems with PHP apps I am writing.

Problem: MySQL seems to try to interpret the statement, meant to simply be data in a field. When I try to "INSERT" the values, I get MySQL syntax errors.

Solution: Does anyone have a way around this problem?
 
Technology news on Phys.org
Do your inserts have apostrophes? You'll need to double them (replace ' with '').
 
verty said:
Do your inserts have apostrophes? You'll need to double them (replace ' with '').

Hmmm, I see what you mean.. I will look into it. Thanks.
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I had a Microsoft Technical interview this past Friday, the question I was asked was this : How do you find the middle value for a dataset that is too big to fit in RAM? I was not able to figure this out during the interview, but I have been look in this all weekend and I read something online that said it can be done at O(N) using something called the counting sort histogram algorithm ( I did not learn that in my advanced data structures and algorithms class). I have watched some youtube...
Back
Top