Jump to content

easy - cant figure out how to put a url in the database without error


jwk811

Recommended Posts

		$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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.