CloudSex13 Posted May 25, 2009 Share Posted May 25, 2009 I'm having problems updating data from a database with apostrophes in it. My SQL statement is as follows: $text = "They're here."; mysql_query("UPDATE Table SET Field='$text'"); Any workaround for this? Thanks! Link to comment https://forums.phpfreaks.com/topic/159589-solved-apostrophe-sql-problems/ Share on other sites More sharing options...
Hybride Posted May 25, 2009 Share Posted May 25, 2009 You have to escape your apostrophe in $test. $text = "They\'re here."; or mod how you put the $text in the query: mysql_query("UPDATE Table SET Field='" . $text . "'"); Link to comment https://forums.phpfreaks.com/topic/159589-solved-apostrophe-sql-problems/#findComment-841748 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.