i have a table which contains images each with a unique id. my database is a project and viewers will have to view the images in the database thus they wont know the id. To be specific, the database contains two tables. one called cars with their various descriptiuons and another one with the fotos of the various cars. I originally wanted to use one datable for both the cars and their fotos but was unable to display the imges. i then decided to build to separate tables. one for the cars and the other for their images which i have to link when searching. the search critaria will be based on the car table. this is the code i used for the image table
$sql = "SELECT * FROM images";
$result = mysql_query ($sql, $db);
while(mysql_num_rows ($result) > 0) {
$row = @mysql_fetch_array ($result);
$image_type = $row["filetype"];
$image = $row["binary_junk"];
Header ("Content-type: $filetype");
echo "$image";
}
But when i try to display the output only the first image is displayed. I cant used any where condition here . as i said these images will be linked to the car table and then displayed. But there is a where condition in the car table. e.g WHERE car = AUDI AND PRICE = £1000 AND .... etc. Do u understand now? I will be very happy if anyone help me sort this out as its giving me headache.
i am using MYSQL.
thanks
NOTE what i am trying to do is something similar to internet dating sites where u can search 4 ladies/men. profiles contain images and the searcher will view all the profiles at once.