Voting

: min(eight, three)?
(Example: nine)

The Note You're Voting On

gherson at snet dot net
24 years ago
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:

<?php
$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;
?>

<< Back to user notes page

To Top