jwk811 Posted April 21, 2009 Share Posted April 21, 2009 $thumbnail = "http://www.sportquadchat.com/images/avatars/" . $thumbnail; $sql = "UPDATE chat_users SET picture_url = '$thumbnail' WHERE id = $userId"; the thumbnail itself will submit just fine. its when i add the url to the beginning and 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 'b1aafd32d4c8cdaf02ad8bc47365d4b9.jpg'' WHERE id = 33' at line 2 i tried changing it around but i cant figure out why it wont work. Quote Link to comment Share on other sites More sharing options...
Mchl Posted April 21, 2009 Share Posted April 21, 2009 It's not easy if you can't figure it out obviously. Can you post whole $sql content? Quote Link to comment Share on other sites More sharing options...
soak Posted April 21, 2009 Share Posted April 21, 2009 try: $thumbnail = mysql_real_escape_string("http://www.sportquadchat.com/images/avatars/" . $thumbnail); Quote Link to comment Share on other sites More sharing options...
avvllvva Posted April 22, 2009 Share Posted April 22, 2009 What is the table field type ???? if it is VARCHAR , change it to TEXT.... then try. Quote Link to comment Share on other sites More sharing options...
Yesideez Posted April 22, 2009 Share Posted April 22, 2009 Why has no-one suggested urlencode() yet? http://uk.php.net/urlencode Then when pulling it from the database use urldecode() http://uk.php.net/manual/en/function.urldecode.php VARCHAR is perfectly fine - just make sure it is set long enough to hold a decent URL. Quote Link to comment Share on other sites More sharing options...
Mchl Posted April 22, 2009 Share Posted April 22, 2009 Why has no-one suggested urlencode() yet? There's hardly need for that in this case... There seems to be nothing that would break the query here. We don't know what is in $thumbnail however. Quote Link to comment Share on other sites More sharing options...
Yesideez Posted April 22, 2009 Share Posted April 22, 2009 Good point - $thumbnail hasn't been verified although going by the sample query IN the OP's post I presumed it was standard text (part of the URL) 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.