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.
 
Thread 'Is this public key encryption?'
I've tried to intuit public key encryption but never quite managed. But this seems to wrap it up in a bow. This seems to be a very elegant way of transmitting a message publicly that only the sender and receiver can decipher. Is this how PKE works? No, it cant be. In the above case, the requester knows the target's "secret" key - because they have his ID, and therefore knows his birthdate.
I tried a web search "the loss of programming ", and found an article saying that all aspects of writing, developing, and testing software programs will one day all be handled through artificial intelligence. One must wonder then, who is responsible. WHO is responsible for any problems, bugs, deficiencies, or whatever malfunctions which the programs make their users endure? Things may work wrong however the "wrong" happens. AI needs to fix the problems for the users. Any way to...
Back
Top