Results 1 to 2 of 2

Thread: updating table

  1. #1
    Join Date
    Jun 2010
    Posts
    243

    updating table

    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.

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

  2. #2
    Join Date
    Sep 2011
    Location
    London, UK
    Posts
    60
    PHP Code:
    mysql_query("UPDATE members SET pword='$pword' WHERE ID='$ID'"); 
    PHP Code:
    mysql_query("UPDATE members SET pword='$pword', email='$email' WHERE ID='$ID'"); 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •