justinbriggs1 Posted February 11, 2009 Share Posted February 11, 2009 Hello, I was wondering how to ignore single quotes in an SQL statement if my PHP variable contains them. Here is partial code:$vision_text = "That's my car";UPDATE riddell_text SET vision_text='$vision_text'I get an error because of the ' in It's.I thought that this would be easy to find, but I can seem to. Thanks,JW Link to comment Share on other sites More sharing options...
justsomeguy Posted February 12, 2009 Share Posted February 12, 2009 $sql = "UPDATE riddell_text SET vision_text='" . mysql_real_escape_string($vision_text) . "'"; Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.