The Mother Board forums. Free tech support, motherboard ID, and more.
It is currently Sun Aug 09, 2020 3:49 pm

Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Wed Dec 21, 2005 3:38 am 

Joined: Fri Jan 23, 2004 11:13 pm
Posts: 79

I am have made a scipt that uploads images to a MySQL database with blob data type from PHP.
Now i am just wondering how i can retrieve the images and display them. I have managed to display One image, but when i try to display multiple images it just doesnt seem to work, and that where i have been stuck for a while now.

Here is the code...
$modelName = "kathy";

$hostname = "localhost";
$username = "root";
$password = "";
$databaseName = "newwavemodels";

// Connect to database
$errmsg = "";
if (! mysql_connect($hostname,$username,$password))
$errmsg = "Cannot connect to database";


$result = mysql_query("select imgdata from pix");

$index = 0;
while($row = mysql_fetch_array($result))
header("Content-type: image/jpeg");
echo mysql_result($result, $index);

My table structure is the following:
`pid` varchar(11) default NULL,
`title` varchar(10) NOT NULL default '',
`imgdata` longblob,
`thumbImage` longblob,
PRIMARY KEY (`title`)

Thanks for any input

Chris Vicatou

Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

Who is online

Users browsing this forum: No registered users and 3 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group