Mailinglisten-Archive |
Moin
ich habe viele Beispiele im Netz gefunden wie ich Dateien aus blobs wieder
aus der DB auslesen und anzeigen kann.
Alle Ergebnisse zeigten bei mir nicht das GIF, sondern Textzeilen, die mit
GIF86 anfingen.
Eins meiner Versuche sah wie folgt aus.
if($id) {
// you may have to modify login information for your database
server:
_(at)_MYSQL_CONNECT( "localhost", "root", "password");
_(at)_mysql_select_db( "binary_data");
$query = "select bin_data,filetype from binary_data where id=$id";
$result = _(at)_MYSQL_QUERY($query);
$data = _(at)_MYSQL_RESULT($result,0, "bin_data");
$type = _(at)_MYSQL_RESULT($result,0, "filetype");
Header( "Content-type: $type");
echo $data;
};
Wo mache ich einen Fehler?
Danke
Michael Köhler
--
Sent through GMX FreeMail - http://www.gmx.net
php::bar PHP Wiki - Listenarchive