Reply to Re: to write an arrau to a table

Your name:

Reply:


Posted by Ulf Kadner on 11/17/07 17:01

Stop & Go wrote:

> array={{"1","Elisabeth","London"},{"2","Antony","Paris"},{"3","Augusto","Roma"},{"4","Tom","Miami"}}
>
> I transform it into a string
> var string="1,Elisabeth,London;2,Antony,Paris;3,Augusto,Rome;4,Tom,Miami"
>
>
> I separated any old array with a ";" and any element of a singhe array with
> ","

And the format of the JS-Array never changes? so you can do it.

> Now I pass to php the string throught a form as an hidden field.
>
> Now I must save any array into a mysql table having 3 fields therefore in
> this case I'll write 3 new records
>
> My PHP Version is 4.4.7.
>
> How can I do please?

- explode the string by ';' separator
- iterate the resulting array
- explode each element of this by ','
- write data into your table

where is the problem?

First you have to learn some PHP-Basics.

So long, Ulf

--
_,
_(_p> Ulf [Kado] Kadner
\<_)
^^

[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

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