Here's the working loop, thanks for your help people
PHP Code:
$artists_setup = array(
'columns_to_show' => 3,
'fetch_artist' => true
);
$choicecounter = 1;
$currentartisttypeid = 0;
while ($artist = mysql_fetch_array($qryartists))
{
$artistimage = $artist['image'];
$artistimageid = $artist['artistimageid'];
$artisttitle = $artist['artisttitle'];
$artisttype = $artist['artisttype'];
if ($currentartisttypeid == 0)
{
$newtype = 0;
}
else
{
if ($currentartisttypeid != $artist['artisttypeid'])
{
$newtype = 1;
$choicecounter = 1;
}
else
{
$newtype = 0;
}
}
if (($choicecounter % $artists_setup['columns_to_show']) == 0)
{
$newrow = 1;
}
else
{
$newrow = 0;
}
eval('$artists .= "' . fetch_template("erc_artistroster_rpt") . '";');
$currentartisttypeid = $artist['artisttypeid'];
$choicecounter++;
}