Jump to content

Update Table ONLY if the value has changed


blackdogupya

Recommended Posts

I have no idea if this is possible or not, but I've got a form that searches a DB for a record.

 

If that record is found, it displays a form that people can edit the record.

 

Now, if that person wants to change (for example) 1 record out of 16 called "status" from "lost" to "found" but leave all the rest as they are, how would I go about this?

 

Basically, I need to check all the fields ON SUBMIT if they're different from the original values in the DB and only update if they are.

 

Any help would be appreciated.

 

Cheers,

 

Dave

you could check your form values against the returned values and build your update query to refference only the fields that don't match the original database return.  if you are doing this over multiple pages you would want to put your database return into a session variable for easier access on the second page.

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.