note 32103 added to function.pg-fetch-all
| From: | php dot net at mechintosh dot com | Date: | Fri, 16 May 2003 16:42:51 +0000 |
| Subject: | note 32103 added to function.pg-fetch-all | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-48113@lists.php.net to get a copy of this message | ||
For versions of PHP that don't yet support the new names or newer functions I wrote a couple
functions like this one
if (! function_exists("pg_fetch_all")) {
function pg_fetch_all($res, $kind="assoc") {
$i = 0; // this is needed for the row integer in the looped pg_fetch_array
if ($kind == "assoc") {
while ($row = pg_fetch_array($res, $i, PGSQL_ASSOC)) {
$array_out[] = $row;
$i++;
}else{
while ($row = pg_fetch_array($res)) {
$array_out[] = $row;
}
}
return $array_out;
}
}
--
http://www.php.net/manual/en/function.pg-fetch-all.php
http://master.php.net/manage/user-notes.php?action=edit+32103
http://master.php.net/manage/user-notes.php?action=delete+32103
http://master.php.net/manage/user-notes.php?action=reject+32103