From:             trendboy at gmail dot com
Operating system: Linux and Windows
PHP version:      5.2.6
PHP Bug Type:     MySQL related
Bug description:  When you try to echo the contents of a BLOB it gives you a 
reference variable

Description:
------------
Steps to reproduce:

1) Create a page to read in a JPEG image from a URL location and inserts
into the database to a BLOB.
2) On another page select * from your blob
3) Using any method, myself_fetch_array or assoc get the contents
4) Print or echo it out

You get Resource ID #5

Dump the vars from the result record set and you get
resource 3 type(mysql result)

It's very strange! It should be displaying the content of the blob to the
screen and with the correct mime header set to jpeg it should show you the
image.

I thought maybe it was a bug on the LINUX version so I installed the
windows version and same issue.

Linux version:
/usr/local/php/bin/php --version
PHP 5.2.4 (cli) (built: Sep 17 2007 22:46:56)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies

mysql --version
mysql  Ver 14.12 Distrib 5.0.27, for pc-linux-gnu (i686) using readline
5.0

I tried 5.2.6 on windows.

It's a right head-wrecker :) Is it a bug?

Reproduce code:
---------------
The code (shortened of course)

my insert is (after I get it from a URL etc): 
mysql_query("insert into thumbnail (image) values ('" . addslashes($img) .
"')");

then to read it:

$sql = "select * from thumbnail where id = 1";
$result = mysql_query($sql);
 var_dump($result);
while ($row = mysql_fetch_assoc($result)){

echo $row[image];
}


Expected result:
----------------
You should see your image


-- 
Edit bug report at http://bugs.php.net/?id=45840&edit=1
-- 
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=45840&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=45840&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=45840&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=45840&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=45840&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=45840&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=45840&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=45840&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=45840&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=45840&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=45840&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=45840&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=45840&r=globals
PHP 4 support discontinued:   http://bugs.php.net/fix.php?id=45840&r=php4
Daylight Savings:             http://bugs.php.net/fix.php?id=45840&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=45840&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=45840&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=45840&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=45840&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=45840&r=mysqlcfg

Reply via email to