Selecting from a list to re-populate

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
SoreE yes
Forum Commoner
Posts: 32
Joined: Wed Oct 11, 2006 3:59 am

Selecting from a list to re-populate

Post 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.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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.
Post Reply