|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2008-02-08 08:12 UTC] 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.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 01:00:01 2025 UTC |
Yes, this issue is known, it only manifests when unicode.semantics=one Here is an excerpt from the sources : /* XXX: What about unicode type ??? Please test :) */ switch(Z_TYPE_PP(field)) { case IS_STRING: { It has been tested, as you also did, and it doesn't work. The code should be ported to PHP6 Unicode but how to do it is out of my area of expertise of working with Unicode+Zend :(