Re: getting integer result from 4.1

From: brew(at)theMode(dot)com
To: PGSQL-PHP(at)postgresql(dot)org
Cc: Mark Nelson <MCN(at)cc(dot)usu(dot)edu>
Subject: Re: getting integer result from 4.1
Date: 2002-12-06 18:46:04
Message-ID: Pine.BSF.4.44.0212061337450.84038-100000@themode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php


Mark.....

> $update = //this is where I execute the query
> $updates = pg_fetch_row($update, 0);
> echo "rows updated=".$updates[0]."<br>";
>
> But that blows up with
> Warning: Unable to jump to row 0 on PostgreSQL result index 6 in
> my php doc.

....probably because there is nothing returned from your query (there is
no row zero, or any other row).

Check into the PHP PostgreSQL funtion pg_numrows docs at php.net (or
pg_num_rows, the name has recently changed depending on which version PHP
you are using).

I usually query, then check the number of rows and loop through them only
if something is returned, else I print out a 'Nothing Found' type of
message.

brew

In response to

Browse pgsql-php by date

  From Date Subject
Next Message brew 2002-12-06 18:47:33 Re: getting integer result from 4.1
Previous Message Mark Nelson 2002-12-06 18:06:56 getting integer result from 4.1