Posted by Rik on 10/17/06 00:28
mantrid wrote:
> Im using arrays generated from my records displayed in a table on my
> site to update the corresponding records in a mysql database ie
>
> on the web page
> col1 col2 col3
> 1 2 2
> 1 6
> 2 7 4
>
> which I post to next page as col1array col2array col3array problem is
> some of the fields in the site's table are blank
> so the arrays are not in sync
Which YOU control, you can make them in sync.
As I understand it, you could make the HTML something like (pseudo-code):
Row1 <input name="col1[1]" /><input name="col2[1]" /><input name="col3[1]"
/>
Row2 <input name="col1[2]" /><input name="col2[2]" /><input name="col3[3]"
/>
Which will keep your POST array in sync.
Even better would be
Row1 <input name="records[1][]" /><input name="records[1][]" /><input
name="records[1][]" />
Row2 <input name="records[2][]" /><input name="records[2][]" /><input
name="records[2][]" />
Which will have all your fields in nice arrays per row already
(print_r($_POST); to check this).
Grtz,
--
Rik Wasmus
Navigation:
[Reply to this message]
|