#42916 [Opn->Fbk]: FETCH_SERIALIZE doesn't work

From: Date: Mon, 10 Nov 2008 11:05:40 +0000
Subject: #42916 [Opn->Fbk]: FETCH_SERIALIZE doesn't work
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-1470@lists.php.net to get a copy of this message
ID: 42916 Updated by: vrana@php.net Reported By: remi dot lanvin at bsocom dot com -Status: Open +Status: Feedback Bug Type: Documentation problem Operating System: Linux 2.6.17.8 PHP Version: 5.2.4 New Comment: What exactly should be documented? Previous Comments: ------------------------------------------------------------------------ [2008-10-11 03:31:05] felipe@php.net See http://cvs.php.net/viewcvs.cgi/php-src/ext/pdo_mysql/tests/pdo_mysql_stmt_fetch_serialize.phpt?view=markup for example. ------------------------------------------------------------------------ [2007-10-12 18:17:37] mj@php.net With PHP 5.3 (latest CVS) I can reproduce the issue. With HEAD however an empty array is returned. (Identical configurations for both builds.) ------------------------------------------------------------------------ [2007-10-12 14:43:41] remi dot lanvin at bsocom dot com I'm still unable to get FETCH_SERIALIZE working with CVS version. I get exactly the same results : - with setFetchMode the returned array is like with FETCH_CLASS alone ; - with fetchAll (or fetch) I get the "cannot unserialize class" error. Additionnaly, according to the documentation, FETCH_SERIALIZE works as FETCH_INTO. However, I'm confused as setFetchMode says "SQLSTATE[HY000]: General error: PDO::FETCH_SERIALIZE can only be used together with PDO::FETCH_CLASS". ------------------------------------------------------------------------ [2007-10-11 21:48:37] iliaa@php.net 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. ------------------------------------------------------------------------ [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)); ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/42916 -- Edit this bug report at http://bugs.php.net/?id=42916&edit=1

« previous php.doc.bugs (#1470) next »