Looktrne Posted February 18, 2008 Share Posted February 18, 2008 can you tell me if there is something wrong with this syntax? I keep getting errors with the syntax $sql = "UPDATE Profiles SET City = '$row[city]', Headline = '$row[name]', LookingFor = '$lf', DescriptionMe = '$desc', DateOfBirth ='$bd', Zip= '$row[zipcode]' WHERE ID='$row[member_id]'"; thanks for any help with this Paul Quote Link to comment Share on other sites More sharing options...
Looktrne Posted February 18, 2008 Author Share Posted February 18, 2008 I get this error: 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 '7" with straight long hair. I like fashion, so my clothing style is a combinati' at line 5 Quote Link to comment Share on other sites More sharing options...
AndyB Posted February 18, 2008 Share Posted February 18, 2008 ... because the unescaped " (in 7") terminates the querystring definition prematurely. Quote Link to comment Share on other sites More sharing options...
aschk Posted February 18, 2008 Share Posted February 18, 2008 Use mysql_real_escape_string() on those variables to avoid this problem. 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.