Using an UPDATE statement in mysql you can make any number of changes to the
record at one time.  What I've done in the past is read in all the fields
from a record, on the webpage displayed the fields that are editable, then
sent all of the variables back through as an update.  You'll need to read
the record first (obviously), then any fields that aren't going to be
modifiable you can either leave out or add them in as hidden form elements.
You can put the data from the fields that you read in as the default data in
the form fields for the user to modify.  When the Submit button is clicked,
then you initiate the update statement (you can find out the full syntax in
the mysql manual) - or run it through a data verification page first,
however you are taking in the data - that includes all of the modifiable
fields, even if some of them weren't changed.

(V)

----- Original Message -----
From: "ODCS" <[EMAIL PROTECTED]>
To: "PHP Windows" <[EMAIL PROTECTED]>
Sent: Saturday, April 05, 2003 6:41 PM
Subject: [PHP-WIN] PHP MySQL question


> I have a database of user inputted information and need to create a page
> where the user can update their information. The user will log in using
> their name and password and then be forwarded to a form with all the
fields
> they can update - but what is the best way to write the records to the
> database. Lets say the user wants to update 3 out of ten fields - would I
> have to write a query for each field and write them one by one, or is
there
> a better way to do this. Any thoughts on this are appreciated.
>
> B.




-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to