From 27b807d1f516db6aa1367465c12eeb2ab6467c24 Mon Sep 17 00:00:00 2001 From: Jason Sheets Date: Mon, 13 Jan 2003 03:17:20 +0000 Subject: [PATCH] updated example to use while git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@111626 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/pgsql/functions/pg-fetch-row.xml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/reference/pgsql/functions/pg-fetch-row.xml b/reference/pgsql/functions/pg-fetch-row.xml index 74b9134e73..3906f4828f 100644 --- a/reference/pgsql/functions/pg-fetch-row.xml +++ b/reference/pgsql/functions/pg-fetch-row.xml @@ -1,5 +1,5 @@ - + @@ -48,13 +48,9 @@ if (!$result) { exit; } -$num = pg_num_rows($result); - -for ($i=0; $i < $num; $i++) { - $r = pg_fetch_row($result, $i); - - for ($j=0; $j < count($r); $j++) { - echo "$r[$j] "; +while ($row = pg_fetch_row($result, $i)) { + for ($j=0; $j < count($row); $j++) { + echo "$row[$j] "; } echo "
";