// In this line you fetch the first result row:
$pic_array = mysql_fetch_array($plant_pics);
// But don't do anything with it.
// In the next line
WHILE($pic_array = mysql_fetch_array($plant_pics))
// you loop through the rest of the results,
// and in the loop block you display them.
You could do either this ๐ :
$plant_pics = mysql_query('SELECT * FROM plant WHERE alphabetical = "c"');
$pic_array = mysql_fetch_array($plant_pics);
$picture = $pic_array['file_name'];
$name = $pic_array['name'];
$alphabetical = $pic_array['alphabetical'];
$plant_id = $pic_array['file_id'];
echo("<a href=\"plantdetail.php\"><img src=\"../$picture.jpg\" alt=\"$name\" width=\"190\" height=\"127\"/></a>");
WHILE($pic_array = mysql_fetch_array($plant_pics))
{
$picture = $pic_array['file_name'];
$name = $pic_array['name'];
$alphabetical = $pic_array['alphabetical'];
$plant_id = $pic_array['file_id'];
echo("<a href=\"plantdetail.php\"><img src=\"../$picture.jpg\" alt=\"$name\" width=\"190\" height=\"127\"/></a>");
}
or this ๐ :
$plant_pics = mysql_query('SELECT * FROM plant WHERE alphabetical = "c"');
WHILE($pic_array = mysql_fetch_array($plant_pics))
{
$picture = $pic_array['file_name'];
$name = $pic_array['name'];
$alphabetical = $pic_array['alphabetical'];
$plant_id = $pic_array['file_id'];
echo("<a href=\"plantdetail.php\"><img src=\"../$picture.jpg\" alt=\"$name\" width=\"190\" height=\"127\"/></a>");
}