Reply to Re: using a set of arrays togther and keeping data in sync?

Your name:

Reply:


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

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация