$qPict = "SELECT pict.cpn_pict";
$qPict = $qPict." FROM cmpny_pict pict";
$qPict = $qPict." WHERE pict.cpn_code='$row[hl_id]'";
$rPict = mysql_db_query($dbname, $qPict); $nPict = mysql_num_rows($rPict);
if ( $nPict == 0 ) {
$qP = "SELECT hlp.hl_pict";
$qP = $qP." FROM hl_pict hlp";
$qP = $qP." LEFT JOIN hl_list hl ON hl.hl_code=hlp.hl_code";
$qP = $qP." WHERE hl.hl_id='$row[hl_id]' ORDER BY hl.hal_int ASC LIMIT 0, 1";
/*$rP = mysql_db_query($dbname, "SELECT * FROM hl_pict WHERE hl_code='$row[hl_code]' ORDER BY hal_int ASC LIMIT 0, 1");*/
$rP = mysql_db_query($dbname, $qP);
$nP = mysql_num_rows($rP);
if ( $nP == 0 ) {
?>
} else {
$rowP = mysql_fetch_array($rP);
?>
}
} else {
?>
for ( $i = 0; $i < $nPict; $i++ ) {
if ( $i == 0 ) {
?>
} else {
?>
}
}
?>
$n = 1;
while ($rowPict = mysql_fetch_array($rPict)) {
if ( $n == 1 ) {
?>
} else {
?>
}
$n++;
}
?>
}
?>