MySQL: Logging SQL Statements for Debugging PHP Apps

  • Thread starter Thread starter rdx
  • Start date Start date
  • Tags Tags
    Mysql Sql
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
2 replies · 4K views
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?
 
on Phys.org
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.