note 35486 deleted from function.pg-fetch-all by didou

From: Date: Wed, 03 Sep 2003 07:40:49 +0000
Subject: note 35486 deleted from function.pg-fetch-all by didou
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-55509@lists.php.net to get a copy of this message
Note Submitter: Julietwll20@yahoo.com ---- 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; } } tasmanian at devil dot com 27-Mar-2003 08:42 It seems like pg_fetch_all() only works on version 4.3.x. I tried it with 4.2.2 and it does not recognize the function, so I assume it won't work on 4 => 4.2.x. jcomeau at whatisthewww dot com 19-Feb-2003 10:02 pg_fetch_all, despite the app note, accepts only one argument, the resultset. It does exactly what is expected, returning a two-dimensional array of the resultset. I suspect the app note given was just copied from pg_fetch_array, which is what you want to use for a single row.

« previous php.notes (#55509) next »