Page 1 of 1

Selecting from a list to re-populate

Posted: Wed Oct 25, 2006 12:32 am
by SoreE yes
Hi, I'm not a programmer and am just learning php, and I need more of a 'general how to' question answered.
I've managed to compose an 'entry form' and have entered a number of events into a mysql database.
When listing a set of events, each row being one record, I want to be able to click on one event and to go the actioned page and populate, with the chosen event, an 'edit event' form.
Two questions? How do I pass over the 'eventID' to the actioned page (or do I pass over an array)?. The second question is how do I populate the form?
This must surely be a common task and perhaps the code is already written in another example you could direct me to. Thanking you for your help in advance.

Posted: Wed Oct 25, 2006 2:46 pm
by feyd
The general concept is to store the record id (or some similar facsimile) in the value attribute of each of the generated options.

To build the options list, you loop over your selection and output an <option> tag for each record that identifies that record uniquely to the action page.