Don't you still have to do mysql_fetch_array()? Because
$get=mysql_query(....) is just a pointer to the mysql_query, right? To grab
the data you'd need to do something like this:

<?php
$sql = "SELECT bin_data FROM binary_data WHERE (id = '$id')";
$get = mysql_query($sql);
$row = mysql_fetch_array($result);

header("Content-type: image/jpeg");
echo $row["bin_data"];

?>

Of course, this is speculation, I never have done any binary data from MySQL
stuff before, but this is what it SEEMS like you should do...change the
Content-type to a gif if its gif data, png if its png data...

-- David Balatero


-----Original Message-----
From: Mark Gordon [mailto:[EMAIL PROTECTED]]
Sent: Sunday, July 29, 2001 11:53 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] How to I fetch an image file from /tmp directory?


I am inserting binary image data into a mysql table  (mediumblob).
Actually, what goes into the table is the /tmp...  pathname.

This is the code I used to try to retrieve, but I get "Resource ID#2"

$get=mysql_query("SELECT bin_data FROM binary_data WHERE id=$id");
print"<img src=$get>";


=====
Mark
[EMAIL PROTECTED]

__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to