RE: [PHP-DB] Binary data
| From: | Chad Day | Date: | Wed, 23 Aug 2000 13:56:08 +0000 |
| Subject: | RE: [PHP-DB] Binary data | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-2297@lists.php.net to get a copy of this message | ||
Here's what I use to display a logo on a page called from a database..
showlogo.php:
$query = mysql_query("select IMG, IMGNAME, FILETYPE from projects where
PROJECTID = '$PROJECTID'");
if ($row = mysql_fetch_array($query)) {
$data = $row["IMG"];
$type = $row["FILETYPE"];
}
Header("Content-type: $type");
echo $data;
and to call this from other pages..
if ($row = mysql_fetch_array($logocheck)) {
echo "<p align=\"center\"><img
src=\"showlogo.php?PROJECTID=$PROJECTID\"></p>";
} else {
echo "No logo.";
}
--
The trick I found was calling it from another script, so I could have the
Header-Type part, and display other content on the page as well.
HTH,
Chad
-----Original Message-----
From: Mike Hammonds [mailto:mhammonds@knowledgeinenergy.com]
Sent: Wednesday, August 23, 2000 9:11 AM
To: php-db@lists.php.net
Subject: [PHP-DB] Binary data
** Reply Requested When Convenient **
Anybody got a sample script for retrieving binary data (images, wav files,
mp3) from a MySQL database
Mike Hammonds, CNE5, MCP-NT
Fellon-McCord & Associates, Inc.
Office: 502.426.4500 Ext. - 7389
Fax: 502.426.8800
mhammonds@knowledgeinenergy.com