jsheets Sun Jan 12 22:17:20 2003 EDT
Modified files:
/phpdoc/en/reference/pgsql/functions pg-fetch-row.xml
Log:
updated example to use while
Index: phpdoc/en/reference/pgsql/functions/pg-fetch-row.xml
diff -u phpdoc/en/reference/pgsql/functions/pg-fetch-row.xml:1.4
phpdoc/en/reference/pgsql/functions/pg-fetch-row.xml:1.5
--- phpdoc/en/reference/pgsql/functions/pg-fetch-row.xml:1.4 Wed Apr 24 21:07:17
2002
+++ phpdoc/en/reference/pgsql/functions/pg-fetch-row.xml Sun Jan 12 22:17:20
+2003
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.4 $ -->
+<!-- $Revision: 1.5 $ -->
<!-- splitted from ./en/functions/pgsql.xml, last change in rev 1.2 -->
<refentry id="function.pg-fetch-row">
<refnamediv>
@@ -48,13 +48,9 @@
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 "<BR>";
--
PHP Documentation Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php