|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2000-11-08 00:22 UTC] chris dot millsaps at wcom dot com
cannot break out of a while loop using pg_fetch_object. code is as follows: It produces the same row over and over.
function showmessages($parentid)
{ global $dblink;
$Query= "Select id, title, created from message where parent='$parentid'";
if (!(dbresult = pg_exec($dblink, $Query))
{
print ("couldn't connect!");
exit();
}
while($row = pg_fetch_object($dbResult, $row))
{
print ("<LI>($row->created) <A HREF=\"");
print ("PHP_SELF?id=$row->id\">");
print ("$row->title</A><br>\n");
showmessages($row->id);
}
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 18:00:01 2025 UTC |
object pg_fetch_object (int result, int row [, int result_type]) You have to specify the row to return, user error. /* Note your typo in (!(dbresult .. and the diff case in variables*/ $numrows = pg_numrows($dbresult); for ($i=0;$i<=$numrows) { $row = pg_fetch_object($dbresult, $i); /* etc */ }