Information: Adding | Updating | Retrieving | Removing | PHP and MySQL
Update Information - Page 92

092 Changing information in an existing row of a table is known as updating the information.
   You might need to update an address when a member moves.
   Or you might have to update a phone number when a member changes his phone number.
   There might have been a field the member left blank and now the member has the current information.

092 Here is the format for the UPDATE Query:
   UPDATE tablename SET column=value, column=value, ...
         WHERE clause

092 In the SET clause you list the columns to be updated and the new values to be inserted into those columns.
   List all the columns that you want to change in one query.
   The WHERE clause indicates which row will be updated.
   Without the WHERE clause, the values for the columns will be updated in all rows.

092 example:
   UPDATE Member SET street="242 Bloomfield Ave",
                                         phone="201-555-5555"
          WHERE loginName="SantaClause"


This site is for the private use of my students. (2008)

Information: Adding | Updating | Retrieving | Removing | PHP and MySQL