leachus2002 Posted August 17, 2010 Share Posted August 17, 2010 Hi All, I have a html form that I can submit using php, which then enters information into a database. This works fine when the text is just standard text - for example "the cat is on the mat". But if I put in "the cat's on the mat" - then the speach mark throws an error up! Is there any way around this? Thanks Matt Link to comment https://forums.phpfreaks.com/topic/210943-problems-with-quotes-and-speech-marks-in-forms/ Share on other sites More sharing options...
pagegen Posted August 17, 2010 Share Posted August 17, 2010 $varuable_name = mysql_escape_string($_POST['your_post']); do that before inserting to db more here: http://php.net/manual/en/function.mysql-escape-string.php Link to comment https://forums.phpfreaks.com/topic/210943-problems-with-quotes-and-speech-marks-in-forms/#findComment-1100238 Share on other sites More sharing options...
leachus2002 Posted August 17, 2010 Author Share Posted August 17, 2010 AH brilliant, thanks for the quick reply, however I am using SQL Server, not MySQL - sorry that was my mistake should have said, is there an equivilent of MYSQL_ESCAPE_STRING for MSSQL? Cheers Matt Link to comment https://forums.phpfreaks.com/topic/210943-problems-with-quotes-and-speech-marks-in-forms/#findComment-1100263 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.