Quote:
Originally Posted by SirAdrian
The array you are feeding the foreach loop is only one row ($artisttype). Are your artist types coming from the database?
|
Yes, i'm pullin gthe artists from the db with the $qryartists query. There's currently 7 artists being returned, and each of them has any one of three different artisttypes assigned to them.
I'm getting them to display as needed within the "erc_artistroster_rpt" template that is contained in the while loop, however when i try to use the foreach loop to group the artists by artisttype and place each group within the "erc_artistroster_typerow" template, i just get the blank screen of death!
Quote:
Originally Posted by rossco_2005
You're also missing a bracket at the end of your foreach:
PHP Code:
foreach (array($artisttype) as $key => $artisttypes
Unless $artist['artisttype'] is going to be an array, you don't need a foreach.
You also don't need array() around it in the foreach if it is going to be an array.
|
oops! thanks for pointing that out- i closed the foreach line, however still having a problem.
Quote:
Originally Posted by JumpD
You also can't use $artist['image'] and the rest of those query results outside the while loop, nor before it as you are doing.
|
So i have to do another query to get just the 3 different artisttypes and then compare the two queries? Forgive my noobishness, i'm still learning and it's nice to receive all of your help.