![]() |
Apostrophe in form causing Error Number: 1064 - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Apostrophe in form causing Error Number: 1064 (/showthread.php?tid=5098) |
Apostrophe in form causing Error Number: 1064 - El Forum - 01-05-2008 [eluser]loopymonkey[/eluser] I have a form with a field called comments, and every time i use an ' in the form I get an error number 1064. For example in my comments field i will type "This's my comment", and I will get this error: Quote:An Error Was Encountered I have global xss_filtering on, and I'm using a model for form input: Code: <?php any help or leads appreciated! Apostrophe in form causing Error Number: 1064 - El Forum - 01-05-2008 [eluser]Craig A Rodway[/eluser] You have a couple of options - have a look here. I'd recommend the Query Bindings option, so your query would be: Code: $sql = "INSERT INTO participants (id,YourName,email,comments) VALUES (NULL, ?, ?, ?)"; Apostrophe in form causing Error Number: 1064 - El Forum - 01-05-2008 [eluser]loopymonkey[/eluser] That was it! thanks! Query bindings seem like the way to go. |