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