Portraits of children
for($counter=0; $counter<$number_of_images;$counter++)
{
echo " ";
}
?>
include '../includes/db.php'; open_database(); $query = "SELECT portrait_filename, portrait_name, category FROM portrait_data WHERE publish_flag = 1 ORDER BY portrait_ref ASC"; $result=mysql_query($query); $counter=0; while ($row = mysql_fetch_assoc($result)) //for each portrait { if($row[category]==3) //if this portrait is flagged to be included in the gallery { $portrait_name[$counter] = stripslashes($row[portrait_name]); $portrait_filename[$counter] = $row[portrait_filename]; $counter+=1; } } $number_of_images = count($portrait_name); ?>