for update the sql query should be like this:
update $table set $field=$value where ...
$table -- your table name
$field -- the field that you want to update in this table
$value -- the new value you want it to be insert into the database
... -- is w=the where clause.
e.g. where ID=2
update to the record which its ID is 2.