Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 2.5.0b5

Doc Bug #14682 MDB2_Driver_Common::prepare() $result_types docs incorrect
Submitted: 2008-09-21 17:49 UTC
From: gauthierm Assigned: cweiske
Status: Closed Package: MDB2 (version 2.4.1)
PHP Version: Irrelevant OS: Irrelevant
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 6 + 50 = ?

 
 [2008-09-21 17:49 UTC] gauthierm (Michael Gauthier)
Description: ------------ The end-user documentation at http://pear.php.net/manual/en/package.database.mdb2.intro-execute.php has incorrect documentation for the prepare() method's third parameter ($return_types). The current documentation states: "Since DML (data manipulation language - INSERT, UPDATE, DELETE) statements have different return values than data fetches the prepare() accepts a third parameter. This parameter should be set to MDB2_PREPARE_MANIP for DML statements. For data reads it should either be set to MDB2_PREPARE_RESULT, an array of data types for each of the columns in the result set or TRUE in order to automatically detect the data types in the result set." This is incorrect as passing "TRUE" for $result_types results in an error instead of automatic type detection. The correct value to pass for automatic type detection is null (or you can simply not specify the third parameter).

Comments

 [2008-09-26 09:16 UTC] quipo (Lorenzo Alberton)
The documentation should be correct, see the _wrapResult() method. What error are you getting?
 [2008-09-26 14:23 UTC] gauthierm (Michael Gauthier)
Here is the message reported in IRC: < mslade> I'm trying to prepare and exec a simple select on MySQL, and am getting a "not supported" error. getUserInfo reveals "Error message: 1 for 0 is not a supported column type" The API docs at http://pear.php.net/package/MDB2/docs/2.4.1/MDB2/MDB2_Driver_Common.html#methodprepare use null instead of true as the default value for the method.
 [2009-10-15 03:06 UTC] cweiske (Christian Weiske)
-Status: Open +Status: Closed -Assigned To: +Assigned To: cweiske
This bug has been fixed in SVN. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.