I've been working at this most of the day, trying to figure out how I can accomplish this sort of form, even looking through countless sites for anything vaguely close to what I'm trying to do for help on logic or syntax behind this (to little to no avail, of course lol). It's a little over my head in terms of sophistication. I've done dynamic forms before, but not like this.
What I'm trying to do is this:
A user needs to update points for attendance in 3 different categories for all people registered to the site - all at once.
There are a total of 3 categories.
I can do the queries fine enough to
(a.) get the total amount of rows and
(b.) the names of all people registered within the site
...and whatever else I might need - that's pretty easy stuff for me these days.
when I do the second query (b) the form will then display the 3 categories for that person like such:
person's Name > cat1 (input text field) > cat2 (input text field) > cat3 (input text field)
and so on and so forth until all users have been populated in this form with each of the 3 categories and input text fields next to their name.
the user would then enter an integer x-xxx (default set to 0) for all users / categories and hit one submit button which would then go to the processing page, which would update the database by adding the new values to the old ones for all fields.
so if, say 5 people were registered, then all 15 values would be submitted at the same time and then updated into the db under their corresponding columns at the same time.
I'm trying to do this with 4 arrays parallel to each other that store all values so that I can put them in one or a few sessions, and transfer all the values at once to the next page.
I've done something similar to this, but not using parallel arrays and without throwing in retrieved data from a db, but since I am - the only way I'm familiar with outputting data from a database for inclusion in a form would be using a while loop like:
while($data = mysql_fetch_array($query))
I've never attempted to output information from a db, and retrieve 1 or more arrays worth of data on the same form before, and I'm finding out very quickly why - its very frustrating...
furthermore, I'm not exactly sure how I would be able to implement arrays into the form dynamically, so that it can store all the values of however many people for all 3 categories before $_POST happens, so the arrays of data are not lost.
Can anyone point me in the right direction, or give me a rough sketch of how this should work? Normally I try to post what code I have, but none of my code works, except for the layout itself including the names, and it's kind of chasing a train wreck at the moment, so I feel this is sort of a mute point to do so.
any help is appreciated.