Search the Community
Showing results for tags 'apostrophe'.
-
Hello I have a problem with my website. I can publish news normally (even whitout an editing system), but there is always a problem: I can't post news that contains a apostrophe ('), because of an error that I don't understand: 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 '</p>','','','','','Autos/Pistas')' at line 1 My code to submit news: $publish="INSERT INTO news(news_title,news_subtitle,news_desc,news_post,news_date,hour,news_image,news_image_peq,categoria) VALUES('".$_POST["news_title"]."','".$_POST["news_subtitle"]."','".$_POST["news_desc"]."','".$_POST["news_post"]."','".$_POST["news_date"]."','".$_POST["hour"]."','".$_POST["news_image"]."','".$_POST["news_image_peq"]."','".$_POST["categoria"]."')"; Thank you in advance
-
Hi, I wonder whether someone may be able to help me please. I'm using the regex expression below as part of my form validation. else if(!preg_match('/^[A-Za-z0-9 .,;-]{5,60}$/', $locationname)) As it currently stands the expression works fine, but I'm having great difficulty when tyrying to add the ' (apostrophe). I've been working on this for a couple of days now, escaping the charcater, moving it to different positions within the expression, sadly without any luck. I just wondered whether someone could possibly look at this please and let me know where I'm going wrong and put me out of my misery . Many thanks and kind regards Chris