in this code I am trying to output all images with the tag I searched. I created 2 images with the same tag 'hi'.
The program is only outputting one of the images though. But when I echo the $rows number it equals 2. When I ran the query in MYSQL it also returned 2 rows. I do not see why ALL the images are being shown.
$input = ($_GET['input']);
$query = "SELECT * FROM `photo`.`photo` WHERE `tags` LIKE '%$input%'";
$result = mysql_query($query);
$data = mysql_fetch_array($result) or die (mysql_error());
$rows = mysql_num_rows($result);
$image = $data['image'];
header('Content-type: image/jpeg');
echo $image;
This isn't all my code but it is all that I think is necessary. Here is what is being shown in another page.
echo "<img src='photolarge.php?input=$input'>"
When I echo $rows it outputs the number 2 so I know the query is working.