Looking for code to create the SET portion of a SQL UPDATE statement from the values of my $_POST variables. For example:
Form has the fields: Location, Street, City
Another form has fields: Name, Phone, Fax
I'd like to only code the UPDATE statement once and have it pull the $_POST variables to populate the SQL.
Instead of:
UPDATE Location
SET Location = '$Location',
Street = '$Street',
City = '$City',
Zip = '$Zip'
WHERE LocationID = '$LocationID'
UPDATE Name
SET Name = '$Name',
Phone = '$Phone',
Fax = '$Fax'
WHERE NameID = '$NameID'
Use:
UPDATE $value
SET $value = '$value'...etc.
Possible??
Thanks, Ruth