portiny mysql to postgres, pg_fetch_array woes

From: ben palmer <ben(at)thatgame(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: portiny mysql to postgres, pg_fetch_array woes
Date: 2001-11-07 21:56:45
Message-ID: 200111072157.IAA19329@wisma.pacific.net.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice


I'm in the process of porting some mysql to postgres, and I'm having trouble with warnings associated with fetch_array

code is something like this
while ($URow=pg_fetch_array($Result,$i++))
{
}

which works, except if the array has no elements, or $i runs off the end of the array, then the pg_fetch_array returns false (as desired), but also generated an unwanted error warning, eg:

-->Warning: Unable to jump to row 0 on PostgreSQL result index 5 in /home/ben/public_html/database.php on line 62

how do I prevent these warnings? Without having to test the number of rows in result.

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Francisco Reyes 2001-11-07 23:36:21 Re: Index not used on single select, but used in join.
Previous Message Tom Lane 2001-11-07 20:41:37 Re: Index not used on single select, but used in join.