prepare("select * from 3304gallcats"); $sql->execute(); while ($carolyn = $sql->fetch()){ echo ''.$carolyn['catname'].'
'."\n"; } $catid = $_GET['catid']; $picsql = $dbh->prepare("select * from 3304gallpix where catid = '$catid'"); $picsql->execute(); while ($maruja = $picsql->fetch()){ $pic = $maruja['id'].'.jpg' ; echo '
'.$maruja['pictitle'].'
'.$maruja['picdesc']."\n"; } ?>