Skip to content

Instantly share code, notes, and snippets.

@alexciarlillo
Created March 24, 2013 18:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexciarlillo/5232869 to your computer and use it in GitHub Desktop.
Save alexciarlillo/5232869 to your computer and use it in GitHub Desktop.
// change this
$row = pg_fetch_row($results);
$num = pg_num_rows($results);
$i=0;
while ($i < $num) {
echo "<pre>";
print_r (pg_fetch_assoc($results,$i));
echo "</pre>";
$i++;
}
pg_close($dbConn);
// to this
while($result = pg_fetch_assoc($results)) {
print_r($result);
}
pg_close($dbConn);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment