Re: Is PDO incompatible with caching mechanismes like APC?



On Sat, 29 Mar 2008 20:54:08 -0700, Jeremy <jeremy@xxxxxxxxxxx> wrote:
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.

Thanks for the tip. This code works:

$sql = "SELECT * FROM mytable";
$sth = $dbh->prepare($sql);
$sth->execute();
store("rows",$sth->fetchAll());

$rows = fetch("rows");
foreach($rows as $row) {
print $row['name'] . "<p>";
}
.