I am trying to display 4 images using PHP and MySQL database. I have to display the 4 images as rows.
I use the table cars with fields (`id_car`, `car_image1`, `car_image2`, `car_image3`, `car_image4`), with all the images being blob datatype.
$id = $_GET['id'];
$link = mysql_connect("localhost", "root", "");
mysql_select_db("cars_database");
$sql = "SELECT car_image1, car_image2, car_image3, car_image4 FROM cars WHERE id_car='$id'";
$result = mysql_query("$sql");
mysql_close($link);
while($row=mysql_fetch_array($result))
{
header('Content-type: image/jpeg');
echo $row['car_image1'];
echo $row['car_image2'];
echo $row['car_image3'];
echo $row['car_image4'];
}
I can only display 1 image and not the other images. Since I am a newbie to this technology I need help.