Re: Is PDO incompatible with caching mechanismes like APC?
- From: Jeremy <jeremy@xxxxxxxxxxx>
- Date: Sat, 29 Mar 2008 20:54:08 -0700
Gilles Ganault wrote:
Hi
APC doesn't like it when I store the output of a SELECT:
<snip>
Does it mean that PDO won't work with APC, and I should look at
another caching tool?
Thank you.
Before an object is stored it has to be serialized. Generally, internal classes (like PDOStatement) cannot be serialized.
It seems like what you want to do is store an array of the rows, which is perfectly possible. Just use $dbh->query(...)->fetchAll() or something similar. The query() method returns a PDOStatement object - while it can be iterated using foreach (thanks to SPL) it is not an array and cannot be serialized.
Jeremy
.
- Follow-Ups:
- Re: Is PDO incompatible with caching mechanismes like APC?
- From: Gilles Ganault
- Re: Is PDO incompatible with caching mechanismes like APC?
- References:
- Is PDO incompatible with caching mechanismes like APC?
- From: Gilles Ganault
- Is PDO incompatible with caching mechanismes like APC?
- Prev by Date: Is PDO incompatible with caching mechanismes like APC?
- Next by Date: Problem installing SVN PHP extension via PEAR in Mac OS
- Previous by thread: Is PDO incompatible with caching mechanismes like APC?
- Next by thread: Re: Is PDO incompatible with caching mechanismes like APC?
- Index(es):
Relevant Pages
|
|