php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #25615 Result of dbx_query
Submitted: 2003-09-20 14:42 UTC Modified: 2003-09-22 03:43 UTC
From: norbert at linuxnetworks dot de Assigned:
Status: Closed Package: Documentation problem
PHP Version: 4.3.1 OS:
Private report: No CVE-ID: None
 [2003-09-20 14:42 UTC] 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. 
 


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-09-22 03:34 UTC] mboeren@php.net
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.


 [2003-09-22 03:43 UTC] mboeren@php.net
I changed the documentation to clarify the return-values that dbx_query produces. This will show up online as soon as the documentation is rebuilt.
Thanks for your support.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Oct 17 09:01:27 2024 UTC