#44076 [Opn]: mysql_result returns nothing with blob

From: Date: Tue, 12 Feb 2008 21:13:52 +0000
Subject: #44076 [Opn]: mysql_result returns nothing with blob
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-122204@lists.php.net to get a copy of this message
 ID:               44076
 Updated by:       felipe@php.net
 Reported By:      jeff76 at operamail dot com
 Status:           Open
 Bug Type:         MySQL related
 Operating System: FreeBSD
 PHP Version:      6CVS-2008-02-08 (snap)
 New Comment:

Works fine to me.
PHP 6.0.0-dev (cli) (built: Feb 12 2008 18:56:58)


Previous Comments:
------------------------------------------------------------------------

[2008-02-08 08:12:57] jeff76 at operamail dot com

Description:
------------
It seems using mysql_result to retrieve a blob doesn't work and returns
nothing (NULL). Using a different function like mysql_fetch_assoc
however does work properly, as does reverting to PHP 5 or retrieving a
non-blob column.

This is using Unicode semantics.

Reproduce code:
---------------
(...connect to DB)

$res=mysql_query('SELECT blob_column FROM table WHERE condition');
$var=mysql_result($res, 0);
print_r($var);
echo(gettype($var));


Expected result:
----------------
(random binary garbage) and a proper variable type (unicode or binary
?)


Actual result:
--------------
gettype returns NULL, and print_r echoes nothing.


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=44076&edit=1


Thread (6 messages)

« previous php.bugs (#122204) next »