NYCPHP Meetup

[nycphp-talk] MySQL UPDATE

Aaron Fischer agfische at email.smith.edu
Tue Apr 5 16:00:13 EDT 2005


Greetings,

Apologies for the obnoxious looking post, I'm really not shouting...  =)

I have run into a little problem with an application that I am building 
that will allow users to add, update and/or delete records from a mysql 
database.  All works well except for the form that is used to edit 
(update) an existing record.

The form page queries the database, retrieves the values, creates the 
form and populates the form fields with the appropriate values.  The 
form properly updates the database record when the user adds a value to 
an empty field or changes the field value.  However, the problem occurs 
when a user wants to remove a value, resulting in the field holding no 
value.  The form will post fine, but the field that contains no value 
will not update the database.  The database field retains it's existing 
data.

I had thought that the value in the database record would be 
overwritten by the empty value coming from the form field.  Clearly it 
isn't.

Would appreciate any tips/pointers; please let me know if additional 
info would be helpful.

Thanks,

-Aaron	




More information about the talk mailing list