Log in

View Full Version : updating table



bberry91
18 Feb 2012, 09:12 AM
how do i update a table with only values that are entered? for example, when the admin types in the id number, and a new password, the password is updated for the user, but all other fields go to blank.


mysql_query("UPDATE members SET uname = '$uname', pword='$pword', email='$email', active='$active' WHERE ID='$ID'");

hyperion
19 Feb 2012, 01:58 AM
mysql_query("UPDATE members SET pword='$pword' WHERE ID='$ID'");



mysql_query("UPDATE members SET pword='$pword', email='$email' WHERE ID='$ID'");