I'm just rewriting some backend management pages, in fact rewriting the
whole database too. One of these pages has a simple HTML form to edit
existing rows. I don't want to populate the form beforehand with all
existing data. I just want to check which of the 20 fields have changed and
update the data accordingly.
Before (I wrote the script years ago, forgive me!), I just had a check
whether any data in each field and each had its own update query .. i.e.
if ($email) {$res=mysql_query("update $table set email='$email' where
id='$id' ");}
if ($contact) {$res=mysql_query("update $table set contact='$contact'
where id='$id' ");}
Now, I must admit that this would still work, but there must be a much
tidier way of doing this ... any pointers appreciated ..
Nick