Subject Re: [firebird-php] blob -> jpg
Author Lester Caine
Dmitry Kalugin wrote:

> Hello, firebird-php!
>
> Displays an empty scope without a picture
> Where at me the error? A picture in a base is
> exactly
>
> <?php
> header("Content-type: image/jpeg");
> if (isset($_GET["ID"])) {
> $ID=$_GET["ID"];
> $sql="select jpgphoto from photos where ID=".$ID;
> require("user.and.pasword.inc.php");
> $rs=ibase_query($dbh,$sql);
> if ($row=ibase_fetch_row($rs)) {
> $jpg=$row[0];
> echo $jpg;
> }
> ibase_free_result($rs);
> ibase_close();
> }
> ?>

You need to get the information *IN* the BLOB rather than the BLOB
handle itself.

Take a look at
http://uk2.php.net/manual/en/function.ibase-blob-get.php
The second comment covers it nicely.

Personally I only store the file name in the database and just access
the file, so I don't actually use it myself ;)

--
Lester Caine
-----------------------------
L.S.Caine Electronic Services