php-db | 2001072
Date: 07/29/01
- Next message: olinux: "[PHP-DB] excellent reference for form info"
- Previous message: Mark Gordon: "[PHP-DB] How to I fetch an image file from /tmp directory?"
- In reply to: Mark Gordon: "[PHP-DB] How to I fetch an image file from /tmp directory?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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:eyesyte <email protected>]
Sent: Sunday, July 29, 2001 11:53 AM
To: php-db <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
eyesyte <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: php-db-unsubscribe <email protected> For additional commands, e-mail: php-db-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribe <email protected> For additional commands, e-mail: php-db-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: olinux: "[PHP-DB] excellent reference for form info"
- Previous message: Mark Gordon: "[PHP-DB] How to I fetch an image file from /tmp directory?"
- In reply to: Mark Gordon: "[PHP-DB] How to I fetch an image file from /tmp directory?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

