Selective Update Using PHP PDO

Not… QUITE true.

You can do it all in one block of code; while the queries are technically different and ‘seperate’.

I… cant actually see where in OP’s code it references an image, the code appears to be an entirely file-upload-dependant form.

But, in basic;

$sql = "UPDATE atable SET datemodified = NOW(), aname = :aname, bname = :bname".((isset($acheckedvalue)) ? ", cname = :cname" : "").", dname = :dname";
$s = $conn->prepare($sql);
$s->bindValue(':aname',$avalue);
$s->bindValue(':bname',$bvalue);
if(isset($acheckedvalue)) { $s->bindValue(':cname',$cvalue); }
$s->bindValue(':dname',$dvalue);