Re: [INTERFACES] web interface php3 question.

From: "Adam Lang" <aalang(at)rutgersinsurance(dot)com>
To: "Rich(dot)Martin" <Rich(dot)Martin(at)wcom(dot)com>
Cc: <pgsql-php(at)postgresql(dot)org>
Subject: Re: [INTERFACES] web interface php3 question.
Date: 2000-10-30 19:40:55
Message-ID: 015801c042a9$51d51840$330a0a0a@6014cwpza006
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php

for ($i = 0; $i < pg_numrows($result); $i++) {
$row_array=pg_fetch_row($result, $i);
}

This works... it should also if you plug in array as opposed to row.

I tried your code also with fetch_row and it bombed out (I changed company
to 0).

Adam Lang
Systems Engineer
Rutgers Casualty Insurance Company
----- Original Message -----
From: "Rich.Martin" <Rich(dot)Martin(at)wcom(dot)com>
To: "Adam Lang" <aalang(at)rutgersinsurance(dot)com>
Sent: Monday, October 30, 2000 2:04 PM
Subject: RE: [INTERFACES] web interface php3 question.

> Yes, that what's got me confused. I've tried it with several variables,
but
> 0, 1, and 7 all get errors (described below). If I don't include any
> variable I get the error message.
>
> I also have a book, PHP Essentials, which uses an example call to a
> PostgreSQL database and they don't use two variable, but I get an error
with
> the same exact call.
>
> Could it be the size of database I'm calling? It has 7 columns but about a
> hundred rows. Do you know if there is a maximum size for a db?
> Rich
>
>
>
>
> -----Original Message-----
> From: Adam Lang [mailto:aalang(at)rutgersinsurance(dot)com]
> Sent: Monday, October 30, 2000 11:42 AM
> To: Rich.Martin; pgsql-interfaces(at)hub(dot)org
> Subject: Re: [INTERFACES] web interface php3 question.
>
>
> It should work with version 3. Are there 7 rows of data in the table? It
> might not let you call it if the row doesn't exist.
>
> http://php.net/manual/function.pg-fetch-array.php
>
> Adam Lang
> Systems Engineer
> Rutgers Casualty Insurance Company
> ----- Original Message -----
> From: "Rich.Martin" <Rich(dot)Martin(at)wcom(dot)com>
> To: <pgsql-interfaces(at)hub(dot)org>
> Sent: Monday, October 30, 2000 1:19 PM
> Subject: [INTERFACES] web interface php3 question.
>
>
> > Hello,
> > I'm trying to setup a web page that calls a PostgreSQL database. I'm
> > connecting to the database ok. Does anyone know if php3 support
> > pg_fetch_array? I keep getting an error that says:
> >
> > Warning: Wrong parameter count for pg_fetch_array() in
> > /home/contacts/whole.phtml on line 72
> >
> > I'm calling it in the code like this:
> >
> > while ($r = pg_fetch_array($result)) {$company = $r["company'];
> >
> > if I add a another variable like this:
> >
> > while ($r = pg_fetch_array($result, 7)) {$company = $r["company'];
> >
> > the resulting page takes forever to load and repeats the first entry to
> the
> > database. I know that the server I'm using has php3 on it. Is that the
> > problem?
> >
> > If you have a solution please let me know.
> > Thanks,
> > Rich

Browse pgsql-php by date

  From Date Subject
Next Message Adam Lang 2000-10-30 19:43:25 Re: [INTERFACES] web interface php3 question.
Previous Message Rodrigo Fernandez 2000-10-30 14:57:00 Dirigir a: Re: php4 / pgsql7 problem (too many clients)