This topic is locked

MYSQL Error

4/30/2007 11:39:53 PM
PHPRunner General questions
E
evan_ad2000 author

Hi,
I have the following error when a incorrect entry is used in a form. Lets say we assume not everyone is very good at typing because the error occurs due to the "\" at the end of the input. Is there any way I can work around this or have a error handler to handle errors like this?
"You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"V2050114\"' at line 1"
Thanks,

Evan

G
giles 5/1/2007

Evan,

I have had to deal with a similar problem with a VB program that interfaces to a mysql data base. I just created some routines to go through the field looking for "problem" text strings before attempting to execute the sql query.

I expect the same could be done in phprunner using code in the Before event. Should be able to handle a few simple cases like use of \ and ".
Good luck.

Alexey admin 5/2/2007

Evan,
PHPRunner handles "bad" symbols in user input fine.

If the error is produced by your event code use mysql_escape_string function to correct the data.
Otherwise please publish your project on Demo account and send a URL to it to support@xlinesoft.com along with instructions on reproducing the error.

E
evan_ad2000 author 5/7/2007

Evan,

PHPRunner handles "bad" symbols in user input fine.

If the error is produced by your event code use mysql_escape_string function to correct the data.
Otherwise please publish your project on Demo account and send a URL to it to support@xlinesoft.com along with instructions on reproducing the error.


Hi,
How can I use thie "mysql_escape_string" function?
Thanks,

Evan

J
Jane 5/8/2007

Evan,
here is an article about this function in the PHP documentation:

http://php.net/manual/en/function.mysql-escape-string.php