Jump to content

[SOLVED] update query


deansaddigh

Recommended Posts

Hi my code is failing at the if/update query

Whats wrong with it.

 

//See wether user allready has avatar in table
		if ($userid !==NULL)
				{
				$query= "UPDATE avatar SET Avatar_path, Avatar_name
				Where User_id=" .$userid;
				$result =mysql_query($query, $conn)
				or die ("unable to perform query");
				}

 

And help would be grately appreciated

Link to comment
https://forums.phpfreaks.com/topic/163332-solved-update-query/
Share on other sites

Hi

 

Something like this

 

//See wether user allready has avatar in table
		if ($userid !==NULL)
				{
				$query= "UPDATE avatar SET Avatar_path = '$filename', Avatar_name = '$path'
				Where User_id=" .$userid;
				$result =mysql_query($query, $conn)
				or die ("unable to perform query");
				}

 

This assumes that $filename and $path are safe (ie, you have run mysql_real_escape_string()  on them).

 

All the best

 

Keith

Link to comment
https://forums.phpfreaks.com/topic/163332-solved-update-query/#findComment-861829
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.