You are here: Re: [PHP] Implode? Explode? « PHP « IT news, forums, messages
Re: [PHP] Implode? Explode?

Posted by Jack Jackson on 06/06/05 22:02

Brent Baisley wrote:
> You're close, but you need to group your data on the series_id first.
> You can do that by looping through your array and creating another array
> using series_id as the array key. You'll end up with a list of arrays
> named after the series_id.
>
> foreach( $result_set as $result_item ) {
> //Add an array item to the series_id slot of the grouped_result array
> $grouped_result[ $result_item['series_id'] ][] =
> array('id'=>$result_items['art_id'], 'title'=>$result_item['art_title']);
> }

That did the trick, Brent. Thanks so much for this useful information.

> Now you have your data grouped by series_id. Each item of the
> grouped_result array will contain one or more arrays which contain the
> art_id and art_title.
>
> If you are not familiar with multidimensional arrays, this may be a
> little confusing.

A little is right! But tanks for the intro to multi-dimensional arrays!

 

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

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