Re: getting integer result from 4.1 - Mailing list pgsql-php

From brew@theMode.com
Subject Re: getting integer result from 4.1
Date
Msg-id Pine.BSF.4.44.0212061337450.84038-100000@themode.com
Whole thread Raw
In response to getting integer result from 4.1  (Mark Nelson <MCN@cc.usu.edu>)
List 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




pgsql-php by date:

Previous
From: Mark Nelson
Date:
Subject: getting integer result from 4.1
Next
From: brew@theMode.com
Date:
Subject: Re: getting integer result from 4.1