siwelis Posted May 6, 2007 Share Posted May 6, 2007 When posting to a form anytime I use a ' I receive this error message: "Error performing query: 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 't it be used?', 'What can't it be used?', 'What can't it be used?'" How do I get PHP to post that text? If available, I could really use some help figuring out how to block out or make null certain texts... such as < and > - Thank you very much! Link to comment https://forums.phpfreaks.com/topic/50267-secure-form-posting-needed-sql-error/ Share on other sites More sharing options...
skali Posted May 6, 2007 Share Posted May 6, 2007 Use addslashes() funtion http://php.net/addslashes Link to comment https://forums.phpfreaks.com/topic/50267-secure-form-posting-needed-sql-error/#findComment-246762 Share on other sites More sharing options...
siwelis Posted May 7, 2007 Author Share Posted May 7, 2007 That did not resolve the issue. Every place I could fine to fit addslashes, I added it, even if it meant replacing stripslashes with it. After adding addslashes, I got the exact same error message due to the ' Perhaps it has something to do with the link I found http://www.newsforge.com/article.pl?sid=06/05/23/2141246 on the page you linked me to. So I changed my PHP version from 4.x to 5.0 and tried again. Still no different. I really appreciate your response! Thank you! I'm pretty much a newbie to PHP and I'm using a book made by the creator of this website. There were a few errors (printing errors?), but I figured them out- The books just kind of old now in technology's terms, so I'm trying to secure code now. -Thanks again!! Link to comment https://forums.phpfreaks.com/topic/50267-secure-form-posting-needed-sql-error/#findComment-246927 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.