#25615 [Opn]: Result of dbx_query
| From: | mboeren@php.net | Date: | Mon, 22 Sep 2003 07:34:11 +0000 |
| Subject: | #25615 [Opn]: Result of dbx_query | ||
| References: | 1 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969356373@lists.php.net to get a copy of this message | ||
ID: 25615
Updated by: mboeren@php.net
Reported By: norbert at linuxnetworks dot de
Status: Open
-Bug Type: Feature/Change Request
+Bug Type: Documentation problem
PHP Version: 4.3.1
New Comment:
Besides the fact that this wouldn't be backwards compatible, I do not
think that a return value of 1 is the exception case.
Whenever you try an insert/update/delete query you expect either
success or failure (1 or 0). When you do a select query you expect a
result set or a failure.
There is no need to test for a result-object OR success: successful
select queries that produce no resultset do return an empty object as
you described (except that cols will not be 0, and columnnames will be
set if the ASSOC flag was passed).
I see that the documentation incorrectly performs this test on a select
query, so I can see why you would report this feature request. I'm
changing this request to a be documentation problem, which I will fix
shortly.
Previous Comments:
------------------------------------------------------------------------
[2003-09-20 14:42:27] norbert at linuxnetworks dot de
Description:
------------
dbx_query should return an empty object (rows = 0,
data empty) instead of 1. This would make code for
the exception case (return value of 1) unnecessary.
Furthermore the API don't have to be changed for this,
so I would be an easy impovement.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=25615&edit=1