Mark
|
| Posted: 11/16/2002, 11:57 AM |
|
Hello,
I am trying to creat a series of forms that update the same record within a database using php mysql.
I.E the person fill in the first record with his first name and sirname then after clicking submit a reocrd is opened in the data base.
the person would then be presented with a form to enter his hobbies. After submitting. This info would be entered into the same database record with his name and sirname.
I wanted to do this in separate forms rather than having one form with a million questions.
thank you for your help.
Mark
|
|
|
 |
xbill
|
| Posted: 11/18/2002, 9:30 AM |
|
Here is a quick solution-
it is probably not the most efficient way,
but should work.
The trick is to use the mysql_insert_id on the
first page and then selectively display fields
from the record on following pages.
On each entry page, instead of showing the whole
record, only present the fields that you
want to collect on the page. Then use the
destination redirect page to enter the next
batch of fields.
On the first page- gather the initial required information
and create the record. Using events and the mysql_insert_id
function, retrieve the new ID of the newly created record.
Save the id and redirect to entry page #2. This
page can be an update screen for additional fields.
Show only the fields on this page that you want to update.
Save the record id and pass it to entry page #3 (etc).
This page can then show additional fields.
Note- this approach really isn't too robust, as a user
may be able to get around the sequence with the forward/back
browser button.
-bill
|
|
|
 |
|