Hi all
I'm encountering a problem with collecting POST data from my form and need any help or advice you can give me.
I have 1 form and in that form I loop through my database of people and display form fields such as first name, last name, age, nationality etc and each form field is displayed as such:
// while loop here for each db record
<input type="text" name=firstname[$personid] />
<input type="text" name=lastnamename[$personid] />
<select name=nationality[$personid]></select>
// close while loop
Now, when I have mutiple people on my form, the POST array looks like this (below), but I do not know how to loop through each element and extract the correct values for each 'personid' to later use in an SQL query:
Array
(
[firstname] => Array
(
[136] => Joe
[139] => Jerry
)
[lastname] => Array
(
[136] => Bloggs
[139] => Bloggs
)
[nationality] => Array
(
[136] => GBR
[139] => ES
)
[age] => Array
(
[136] => 23
[139] => 43
)
)
Can anyone who has more knowledge of dealing with POST arrays than me (!) help me here?
Many thanks for reading.
Doug