Jump to content

update query


praethorian

Recommended Posts

Hi all,

 

I have a classic edit.php file, with 8 file fields (named fname1 - fname8).

User already uploaded pictures and he decided to change some of them.

 

This is sql query that update all columns in the table.

$q = "UPDATE photos SET image1=$fname1, image2=$fname2,..., WHERE id = $id";

,

 

but I would like to update only newly submitted pictures and the old ones leave.

$q = "UPDATE photos SET ".if(isset($fname1)){."image1=$fname1".}.", image2=$fname2,..., WHERE id = $id";

 

Guess I can't do it like the above code.

Any help would be most welcome.

 

Cheers Pete

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/148363-update-query/
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.