|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2008-04-11 09:38 UTC] david at zegrange dot com
Description:
------------
Hello. We were using PHP 5.1.6 (mandriva 2007) with not problem, then we ugraded to PHP 5.2.5 (mandriva 2008 or 2008.1) on new server and suddenly our BLOB fiels (is a small image) are not being returned. I have verified that they still store properly in the Firebird 2.0 database. No problem with the other functions.
If i downgrade back to PHP 5.1.6 (mandriva 2007) on new sever, the problem is fixed.
Other Interbase/Firebird functions are working well.
Thank's for your feeback.
Reproduce code:
---------------
The table in dbtest.fdb:
CREATE TABLE DF_ETAT (
ETAT_NO SMALLINT NOT NULL,
ICONE BLOB SUB_TYPE 0 SEGMENT SIZE 80,
);
The php file : test.php
<?
header('Content-type: image/png');
$dbi = ibase_connect('db_server:/data/dbtest.fdb','SYSDBA','masterkey','NONE');
$sql = "SELECT ICONE FROM DF_ETAT WHERE ETAT_NO=20";
$sth = ibase_query($dbi,$sql);
$row = ibase_fetch_object($sth);
$blob = ibase_blob_echo($row->ICONE);
$ibase_close($dbi);
?>
Expected result:
----------------
I expected to see my BLOB fields on the web page test.php
Actual result:
--------------
I didn't see my BLOB fields.
Error log message for httpd return :
[error] [client 192.168.1.57] PHP Warning: ibase_blob_echo() [<a href='function.ibase-blob-echo'>function.fbird-blob-echo</a>]: BLOB not found in /var/www/html/test.php on line 6
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 12:00:01 2025 UTC |
Here is the code: function glGetPic2() { $sql = "select a.id, a.descri, a.url, b.purpose, a.pic, a.mime from glpics a left outer join picpurps b on b.idpurp=a.idpurp where a.iden = ".$_REQUEST["iden"]." and a.idtabla = ".$_REQUEST["idtabla"]; $con = ibase_connect("glpics","sysdba","kliam56") or die(ibase_errmsg()." No se pudo conectar a la base glpics"); $res = ibase_query($con,$sql); while($dat = ibase_fetch_row($res)) { echo "<div style='width:65%;margin:0 auto 0 auto;' >"; if(strlen($dat[2]) > 0) { // se trata de un URL echo "<img style='width:90%;display:block;margin:0 auto 0 auto' src=\"".$dat[2]."\" />"; } else { // se trata de un blob /* $bi = ibase_blob_info($dat[4]); $ln = $bi["length"]; $bo = ibase_blob_open($dat[4]); $pblo = ibase_blob_get($bo,$ln); ibase_blob_close($bo); $fp = fopen("/home/lazaro/public_html/img/glpic".$dat[0].".jpg","w"); fputs($fp,$pblo,$ln); fclose($fp); echo "<img style='width:90%;display:block;margin:0 auto 0 auto' src='img/glpic".$dat[0].".jpg' >";*/ header("Content-Type: ".$dat[5]); ibase_blob_echo($dat[4]); } echo "<p>".$dat[1]." (".$dat[3].")</p></div>"; } } As I receive the data, it comes in the form of characters from the content of the blob. My text is properly inserted. It is received through ajax, but the result in a direct URL is just as wrong, except that it wants to save the page. It definitely doesn't show the images. They're all jpg now.