mysql code:
CREATE TABLE imageslinks (
imageID mediumint(8) unsigned NOT NULL auto_increment,
imageLink varchar(250) NOT NULL,
name varchar(255) not null,
address varchar(255),
PRIMARY KEY (imageID),
) TYPE=MyISAM AUTO_INCREMENT=1;
insert into imageslinks values (1,'service_01.jpg','danny blancheflower','123 here street');
insert into imageslinks values (2,'service_02.jpg','david blaine','45 west 45 street');
insert into imageslinks values (3,'service_03.jpg','rolf harris','123 rue de la rue, la rochelle');
php code:
<body>
<?php
//$db = mysql_connect_db("localhost","","");
$db=mysql_connect('localhost','root');
mysql_select_db("danny",$db);
$imageid = isset( $GET['imageID'] ) ? $GET['imageID'] : '';
//$imageid; //contains the unique_id of the required image
$sql="SELECT * FROM imageslinks WHERE imageID='$imageid'";
$res=mysql_query($sql) or die(mysql_error());
$row=mysql_fetch_array($res, MYSQL_ASSOC);
print('<img src="http://localhost/images/'.$row['imageID'].'" />');
?>
</body>
i am stumped as to why this didnt work. can you help please? what is wrong with this code?
does there need to be any coding towards IMAGEBLOB?