I'm trying to show images with a specific subject on the screen. I have 5 images with the same subject and it only shows one image. If I change the subject of the image in the database, the next image with the subject I try to call appears.
function selectSubject($subject){
$showSubject = mysql_query("SELECT name FROM images WHERE subject = '$subject'");
while($showSubject = mysql_fetch_array($showSubject)){
$source_subject_trees = $showSubject['name'];
echo "<img class=\"subject_images\" src='img/$source_subject_bomen'></>";
}
};
mysql_fetch_array. Rename one of them, and you should be fine - at the moment, the database result set in$showSubjectis being over-written by the first record, and ending the loop.