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! Quote Link to comment 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 . "'"); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.