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!

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to