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 Link to comment https://forums.phpfreaks.com/topic/91636-mysql-syntax-error/ 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 Link to comment https://forums.phpfreaks.com/topic/91636-mysql-syntax-error/#findComment-469316 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. Link to comment https://forums.phpfreaks.com/topic/91636-mysql-syntax-error/#findComment-469352 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. Link to comment https://forums.phpfreaks.com/topic/91636-mysql-syntax-error/#findComment-469401 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.