You are here: Re: Storing array in a row « PHP Programming Language « IT news, forums, messages
Re: Storing array in a row

Posted by Rik on 05/11/06 03:47

guitarromantic@gmail.com wrote:
> I wanna make a multiple select form
> so we can just select all the contributors and have the values saved
> in the database - in one row (something like "56,34,21" etc).

$author = implode(',',$_POST['author']);

And if you'd need to extract it all again:

$authors = explode(',',$author);
(assuming there is no ',' in the $Staff_id)

Allthough, if it becomes a common habit, maybe an extra table will be
preferred. It would make handling data on the database side somewhat easier.

If this doesn't work:
1. Did you deribately set action='' in your form?
2. print_r($_POST), does your $_POST['author'] contain the values?

Grtz,
--
Rik Wasmus

 

Navigation:

[Reply to this 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

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