This topic is locked
[SOLVED]

 Writing a log table of sql requests

11/25/2009 5:26:02 AM
PHPRunner General questions
rjks author

Morning,
I am trying to keep a log of sql requests made to add change edit and delete data. The problem ist I am writing the SQL Request into another table and I keep getting an error because of the ' in the request.
I am using the after edit Event.

spo_WriteLog("Dienste Open Change Requestlist",$strSQL." ".$strWhereClause." ".$strOrderBy)


mySQL keeps telling me that there is an error and points to the ' in the SQL Request.
How can I mask the ' in the SQL Request so that it will be saved as text in the log file?
Thanks in advance.
Robert Künkel-Smith

J
Jane 11/25/2009

Robert,
could you give me more detailed description of what you want to achieve?

rjks author 11/26/2009

Morning Jane,
what I want is to write the mySQL Request String into another table as a string.

The ' were causing problems and mySQL gave an error.
The answer was with to use str_replace

str_replace("'","´",$i_info["query"]);


didn´t work but escaping the ' in '' works.

str_replace('\'','´',$i_info["query"])


Thanks anyway
Robert