Re: [GENERAL] PHP3 and PostgreSQL

From: eschmid <eschmid+sic(at)s(dot)netic(dot)de>
To: sheila bel <sheilabel(at)hotmail(dot)com>
Cc: pgsql-general(at)postgreSQL(dot)org
Subject: Re: [GENERAL] PHP3 and PostgreSQL
Date: 2000-02-20 21:20:59
Message-ID: Pine.BSF.4.10.10002202159540.76138-100000@mail.s.netic.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Sun, 20 Feb 2000, sheila bel wrote:

> I'm trying to do the equivalent of the following command of
> mysql (inside PHP3 code) in postgreSQL.

Oh I see there can help only Oliver Elphick or Paul DuBois.

> 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

The function prototype looks right now like:

/* {{{ proto object pg_fetch_object(int result, int row)
Fetch a row as an object */

> $num=0
> while (($row = mysql_fetch_object($result,$num))) ...
>
> $num++;

While the function prototype in MySQL looks:

/* {{{ proto object mysql_fetch_object(int result [, int result_typ])
Fetch a result row as an object */

The optional result_typ is a constant and can be set to MYSQL_ASSOC,
MYSQL_NUM, or MYSQL_BOTH.

> this is the error message I get :
>
> Warning: Unable to jump to row 1 on PostgresSQL result index 2

This means, you don't have a second row numbered 1 in result index 2.

-Egon

PS: If this is misleading, I should read the PHP documentation myself a
couple of times.

--
Besuchen Sie Six auf der CeBIT (24.2.-1.3.) in Halle 10, Stand 425,
und auf der Hannover-Messe (20.-25.3.) in Halle 14, Stand J50!

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jeff Davis 2000-02-20 21:33:34 Re: [GENERAL] PHP3 and PostgreSQL
Previous Message Charles Tassell 2000-02-20 21:08:42 Re: [GENERAL] PHP3 and PostgreSQL