Re: [GENERAL] PHP3 and PostgreSQL - Mailing list pgsql-general

From Charles Tassell
Subject Re: [GENERAL] PHP3 and PostgreSQL
Date
Msg-id 4.2.0.58.20000220170535.00b21400@mailer.isn.net
Whole thread Raw
In response to PHP3 and PostgreSQL  ("sheila bel" <sheilabel@hotmail.com>)
List pgsql-general
Try something like:
$NumRows = pg_NumRows($Result);
for ($CurRow =0; $CurRow < $NumRows;  $CurRow++) {
         $row = pg_Fetch_Object($Result, $CurRow);
         ....
}

I've never used Fetch_Object, but I know that this works with
Fetch_Array.  Also, if you consult the pg_Fetch_Object item in the quick
reference on http://www.php.net/ it will probably have a code example.


At 04:29 PM 2/20/00, sheila bel wrote:
>SORRY, WRONG SUBJECT IN PREVIOUS MESSAGE.
>
>Hi all,
>
>I'm trying to do the equivalent of the following command of
>mysql (inside PHP3 code) in postgreSQL.
>
>while (($row = mysql_fetch_object($result))) .....
>
>I know there is the pg_fetch_object($result, ?) but I don't
>know what to use for ?. I tried 0 and it does an exhaustive
>search. I tried using something like $num
>
>$num=0
>while (($row = mysql_fetch_object($result,$num))) ...
>
>$num++;
>
>this is the error message I get :
>
>Warning: Unable to jump to row 1 on PostgresSQL result index 2
>
>Any ideas ?
>
>thanks,
>-Sheila
>______________________________________________________
>Get Your Private, Free Email at http://www.hotmail.com
>
>
>************


pgsql-general by date:

Previous
From: "sheila bel"
Date:
Subject: PHP3 and PostgreSQL
Next
From: eschmid
Date:
Subject: Re: [GENERAL] PHP3 and PostgreSQL