Re: Postgre Prob
| From: | Jeff MacDonald | Date: | Sat, 11 Nov 2000 21:12:42 +0000 |
| Subject: | Re: Postgre Prob | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-4377@lists.php.net to get a copy of this message | ||
i think i ran into this quite some time ago. while loops
are alittle quirky.. give this a try..
for($i=0;$i < pg_numrows($ret);$i++) {
$row = pg_fetch_object($ret,$i);
}
basically it's farting out because it's trying to go
one more iteration that is available.. tru you may see
8 rows in your database, but it's likly counting from
0 to 7 and so it can't jump to 8
jeff
On Sat, 11 Nov 2000, Nicolas Raitman wrote:
> Hi to all. I have a table I created the following table in database called
> clients doing the following:
>
> create table people (name varchar(50), lastname varchar(50), phone
> varchar(60), comment varchar(50));
>
> the, with php I do the following
>
> $con = pg_connect("dbname = clients");
> $ret = pg_query($con, "Select * from people");
>
> $row = 0;
> while ( $data = pg_fetch_object ($ret, $row))
> {
>
> printf("<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>",
> $data->name, $data->lastname, $data->phone, $data->comment);
> $row++;
> }
>
> Ok... when I execute the script I get everything ok but also the following
> warning:
>
> unable to jump to row 8 on PostgreSQL result index 5 in line...
>
> Of course, the number of the row depends on how many records I have on the
> table. The thing is that it shows me ecxactly the same number of records in
> tne table as the number of the row that it complains about jumping at...
> what is it wrong?
>
> Thanks a lot,
> Nicolas
>
>
>
Jeff MacDonald,
-----------------------------------------------------
PostgreSQL Inc | Hub.Org Networking Services
jeff@pgsql.com | jeff@hub.org
www.pgsql.com | www.hub.org
1-902-542-0713 | 1-902-542-3657
-----------------------------------------------------
Facsimile : 1 902 542 5386
IRC Nick : bignose