Pictures in DB
Posted: Sat Nov 20, 2004 8:19 pm
Hi,
I created a page that displays information about some applications (models). Everything works perfect, with a small exception. I need to display its picture as well. They are stored in a DataBase. I tried a reference of $_GET . REQUEST …. I can’t get it to work . I am more a designer than a programmer however I started in PHP MYSQL ………… LOL.
I am using the following code:
they work fine for :for picture # 3.
But I need it to display by models id (id) . Can somebody provide me with right answer please .
Thanks ....
I created a page that displays information about some applications (models). Everything works perfect, with a small exception. I need to display its picture as well. They are stored in a DataBase. I tried a reference of $_GET . REQUEST …. I can’t get it to work . I am more a designer than a programmer however I started in PHP MYSQL ………… LOL.
I am using the following code:
Code: Select all
<?php
$sql2="SELECT * FROM image INNER JOIN model WHERE model.ID=image.id AND image.id ='".$_GET['id']."'";
$result = mysql_query($sql2) OR DIE (mysql_error());
if (mysql_num_rows($result)>0){
$row = @mysql_fetch_array ($result);
$image_type = $row["image_type"];
$image = $row["image"];
Header ("Content-type: $image_type");
print $image;
}
mysql_close();
?>they work fine for :
Code: Select all
<img src="application_group.php?id=3">But I need it to display by models id (id) . Can somebody provide me with right answer please .
Thanks ....