Re: Is PDO incompatible with caching mechanismes like APC?
- From: Gilles Ganault <nospam@xxxxxxxxxx>
- Date: Sun, 30 Mar 2008 13:26:45 +0200
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>";
}
.
- 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
- Re: Is PDO incompatible with caching mechanismes like APC?
- From: Jeremy
- Is PDO incompatible with caching mechanismes like APC?
- Prev by Date: Re: Form helper issues "Invalid argument supplied for foreach()"
- Next by Date: Re: Is PDO incompatible with caching mechanismes like APC?
- Previous by thread: Re: Is PDO incompatible with caching mechanismes like APC?
- Next by thread: Re: Is PDO incompatible with caching mechanismes like APC?
- Index(es):