note 11769 added to pg_fetch_array

From: Date: Tue, 06 Mar 2001 15:30:58 +0000
Subject: note 11769 added to pg_fetch_array
Groups: php.notes 
Request: Send a blank email to php-notes+get-11936@lists.php.net to get a copy of this message
In addition to returning "false if there are no more rows", pg_fetch_array will also trigger an E_WARNING. You can temporarily turn that error reporting level off and suck out all your data like so: $errRptLvl = error_reporting(); error_reporting($errRptLvl & ~(E_WARNING)); list($i,$j)=array(0,0); while ($selection[$i++] = $this->fetchArray($j++)); // (fetchArray is a pg_fetch_array wrapper.) error_reporting($errRptLvl); // Restore error reporting level. unset($selection[$i-1]); // Delete the last, empty row. return $selection; http://www.php.net/manual/en/function.pg-fetch-array.php

« previous php.notes (#11936) next »