#31750 [Fbk->Opn]: pg_fetch_array fails if PGSQL_ASSOC is specified
| From: | mancini at nextcode dot org | Date: | Sun, 30 Jan 2005 02:55:14 +0000 |
| Subject: | #31750 [Fbk->Opn]: pg_fetch_array fails if PGSQL_ASSOC is specified | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-73057@lists.php.net to get a copy of this message | ||
ID: 31750
User updated by: mancini at nextcode dot org
Reported By: mancini at nextcode dot org
-Status: Feedback
+Status: Open
Bug Type: PostgreSQL related
Operating System: windows 2000
PHP Version: 5.0.3
New Comment:
The PostgreSQL version i am running is 8.0.0 windows oficial binary
release
here is the VERSION() output
PostgreSQL 8.0.0 on i686-pc-mingw32, compiled by GCC gcc.exe (GCC)
3.4.2 (mingw-special)
Previous Comments:
------------------------------------------------------------------------
[2005-01-29 20:34:50] tony2001@php.net
Can't reproduce with 5.0.3 & PG 7.3.6 under Linux.
Please provide more info.
------------------------------------------------------------------------
[2005-01-29 09:29:30] mancini at nextcode dot org
Description:
------------
Tested with original php_pgsql 7.4 binary distribution on php 5.0.3
distribution
The function fails every time if PGSQL_ASSOC is specified to
pg_fetch_array
It works fine if that is not specified , and pg_fetch_assoc() works
too btw , furthermore mysql_fetch_assoc() with MYSQL_ASSOC works too
And quite disturbing looking for the error message on google
http://www.google.com/search?hl=en&lr=&q=%22Unable+to+jump+to+row+1+on+PostgreSQL+result+index%22
gives about 2,620 results of pages experiencing it
Reproduce code:
---------------
$query = "SELECT usename,passwd,usesuper FROM pg_user";
$result = pg_query($query);
while ($line = pg_fetch_array($result,PGSQL_ASSOC)){
echo $line['usename'];
}
Expected result:
----------------
pgsql
Actual result:
--------------
PHP Warning: pg_fetch_array() Unable to jump to row 1 on PostgreSQL
result index 4 in C:\apache2triad\htdocs\test.pgsql.php on line 4
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=31750&edit=1