ID:               42916
 Updated by:       [EMAIL PROTECTED]
 Reported By:      remi dot lanvin at bsocom dot com
-Status:           Open
+Status:           Feedback
 Bug Type:         PDO related
 Operating System: Linux 2.6.17.8
 PHP Version:      5.2.4
 New Comment:

Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows (zip):
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip

For Windows (installer):

  http://snaps.php.net/win32/php5.2-win32-installer-latest.msi

Works in CVS.


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

[2007-10-10 13:51:00] remi dot lanvin at bsocom dot com

If I repeat the fetch mode as an argument to fetchAll(), I get the
following error :

SQLSTATE[HY000]: General error: cannot unserialize class

Reproduce code :

$results->setFetchMode(PDO::FETCH_CLASS | PDO::FETCH_SERIALIZE,
'MyClass');
print_r($results->fetchAll(PDO::FETCH_CLASS | PDO::FETCH_SERIALIZE));

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

[2007-10-10 13:03:54] remi dot lanvin at bsocom dot com

Description:
------------
PDO::FETCH_SERIALIZE doesn't provide a serialized string.

Reproduce code:
---------------
class MyClass { }

$dbh = new PDO($dsn, $user, $password);
$results = $dbh->query($sql);
$results->setFetchMode(PDO::FETCH_CLASS | PDO::FETCH_SERIALIZE,
'MyClass');
print_r($results->fetchAll());

Expected result:
----------------
An array of serialized strings.

Actual result:
--------------
An array of unserialized MyClass objects (similar as with FETH_CLASS
alone).


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


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

Reply via email to