'; $query = $db->query(" select * from productsheets as p, pscats as pc, typeid as ti where p.PSCatsid = pc.id and p.typeid = ti.id and p.branded = 2 and p.Hidden = '0' and pc.pageid = '10' order by pc.PSCats, p.DisplayName "); $catname = ''; while($row = $query->fetch_assoc()) { if($catname != $row['PSCats']) { echo '
'.$row['PSCats'].'

'; $catname = $row['PSCats']; } echo '
'.$row['DisplayName'].'
Download
'; } echo ' '; ?>