FW: [PHP] pg_fetch_object: Unable to jump to row....

From: Date: Wed, 01 Nov 2000 07:14:13 +0000
Subject: FW: [PHP] pg_fetch_object: Unable to jump to row....
Groups: php.general 
Request: Send a blank email to php-general+get-23107@lists.php.net to get a copy of this message
try this : 23 $qry = pg_exec ($db_conn , "select * from client"); 24 25 $row = 0; // postgres needs a row counter other dbs might not 26 while ($data = pg_fetch_array ($qry, $row)) { 27 echo $data["cl_id"]." ("; 28 echo $data["cl_name"] ."): "; 29 echo $data["cl_address"]."<BR>"; 30 $row++; 31 } -----Original Message----- From: george [mailto:george]On Behalf Of George Patterson Sent: Wednesday, November 01, 2000 6:17 AM To: php-general@lists.php.net Subject: [PHP] pg_fetch_object: Unable to jump to row.... I'm having trouble writing the following code to loop through the database display. Actually it is borrowed almost directly from the php Manual... I did change some of the variables to fit. line nubers 23 $qry = pg_exec ($db_conn , "select * from client"); 24 25 $row = 0; // postgres needs a row counter other dbs might not 26 while ($data = pg_fetch_object ($qry, $row)): 27 echo $data->cl_id." ("; 28 echo $data->cl_name ."): "; 29 echo $data->cl_address."<BR>"; 30 $row++; 31 endwhile; = pg_exec ($db_conn , "select * from client"); 1 (Client 1): Vientiane 2 (Client 2): Vientiane Warning: Unable to jump to row 2 on PostgresSQL result index 2 in /home/httpd/html/Internal/webdesign/DomainClient.php on line 26 Software details PHP: Version 3.0.12 Apache: 1.3.9 (Unix) Help much Appreciated George Patterson -- george@laopdr.com Network Administrator Planet Online Vientiane, Lao PDR -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#23107) next »