PHPro Posted October 21, 2009 Share Posted October 21, 2009 Hello! Its Me again, please warn me if I keep posting topics. How can I avoid this error 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 It comes out when I add ''' three single quotes to my textarea and if I make it four '''' single quotes it will run successfully. It occurs whenever it finds a single quote missing its partner. Link to comment https://forums.phpfreaks.com/topic/178457-solved-help-again/ Share on other sites More sharing options...
Garethp Posted October 21, 2009 Share Posted October 21, 2009 $Textarea = mysql_real_escape_string($Textarea); Use that before you put it into your query Link to comment https://forums.phpfreaks.com/topic/178457-solved-help-again/#findComment-941076 Share on other sites More sharing options...
PHPro Posted October 21, 2009 Author Share Posted October 21, 2009 Thank you! Im learning so much:) Link to comment https://forums.phpfreaks.com/topic/178457-solved-help-again/#findComment-941078 Share on other sites More sharing options...
PHPro Posted October 21, 2009 Author Share Posted October 21, 2009 My textarea if $PC how to do I insert mysql_real_escape_string() function if(empty($_POST['Product_Comment'])){ $errors[] = 'Please populate this field'; }else{ $PC = trim($_POST['Product_Comment']); } Link to comment https://forums.phpfreaks.com/topic/178457-solved-help-again/#findComment-941082 Share on other sites More sharing options...
Bricktop Posted October 21, 2009 Share Posted October 21, 2009 $PC = trim(mysql_real_escape_string($_POST['Product_Comment'])); Hope this helps. Link to comment https://forums.phpfreaks.com/topic/178457-solved-help-again/#findComment-941083 Share on other sites More sharing options...
PHPro Posted October 21, 2009 Author Share Posted October 21, 2009 Thanks man. Link to comment https://forums.phpfreaks.com/topic/178457-solved-help-again/#findComment-941087 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.