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

Posted by guitarromantic on 05/11/06 04:06

Rik wrote:

> $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)

Thankyou for this, very helpful.

> 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.

Out of a database of about 780 reviews, 65 are multiple authors. I
think it'd be more of a headache to work the other way (plus I can't
really get my head around how I'd have to restructure the database).

> 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?

1. Nope, bad coding on my part. Removed.
2. (It didn't work) Yeah, it's got the values, and the one that ends up
in the db is author[0]. Is there anything special I need to do on the
database field for this data? I just have it as a standard int
currently.

Matt

 

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

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