Re: #18417 [Opn->Bgs]: pg_fetch_array says Unable to jump to row 0 on PostgreSQL result index
| From: | Melvyn Sopacua | Date: | Sun, 28 Jul 2002 11:29:15 +0000 |
| Subject: | Re: #18417 [Opn->Bgs]: pg_fetch_array says Unable to jump to row 0 on PostgreSQL result index | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-86266@lists.php.net to get a copy of this message | ||
Yasuo,
this actually raises a point I've been meening to ask you about.
Is there any chance you can make the second argument optional?
This makes it easier to write db classes, which are interchangeable between mysql and pgsql.
I think It currently can be done in php, but you'd need to make an array of resultsets, which
keep a static variable or object property for the last retrieved row PER resultset and that gets messy.
However - letting C handle this, is much faster. Problem is: it would break BC unless something
really smart is cooked up, as currently the third argument is optional and PGSQL_* constants
are integers (if you changed them to chars, it would only break scripts that interpret these constant
values instead of the constants themselves, which I think is rare).
Basically, what it boils down to is: are all db extensions *_fetch_array gonna be named and act the
same and if so, what is the target to do this, before or with PHP-5?
At 10:52 28-7-2002 +0000, yohgaki@php.net wrote:
ID: 18417 Updated by: yohgaki@php.net Reported By: mfahey@enter.net -Status: Open +Status: Bogus Bug Type: PostgreSQL relatedOperating System: freebsd-latestPHP Version: 4.1.2New Comment: Sorry, but the bug system is not the appropriate forum for asking support questions. Your problem does not imply a bug in PHP itself. For a list of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php Thank you for your interest in PHP. If you ask php-general, someone may answer. Try 4.2.x or later if you would like, there are many new useful functions. Previous Comments: ------------------------------------------------------------------------ [2002-07-18 14:48:43] mfahey@enter.net pg_fetch_array says this "Unable to jump to row 0 on PostgreSQL result index" when the query returns no results. How is one suppose to Get an ASSOC array with using @ infront of the function and not getting an error when the query has no results? $tmp = pg_fetch_array($results,0,PGSQL_ASSOC); ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=18417&edit=1