first create the table [CODE] create table images ( image_id serial, filename varchar(255) not null, mime_type varchar(255) not null, file_size int not null, file_data longblob not null, primary key (image_id), index (filename) ); [/CODE] the file to output the images to the browser [B]picsrc.php[/B] [CODE]<?PHP //detect if image is called correctly if($image){ //connect to db $db = mysql_connect('localhost', 'user', 'password'); //find the image $query = sprintf('select * from images where filename = %d', $image); $result = mysql_query($query, $db); $image = mysql_fetch_array($result); //tell the browser the url is an image header('Content-type: ' . $image['mime_type']); header('Content-length: ' . $image['file_size']); //finally output the …

Member Avatar
Member Avatar
+0 forum 4

The End.