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

Bug #5705 using loadDBResult with DB_FETCHMODE_OBJECT
Submitted: 2005-10-17 07:37 UTC Modified: 2006-06-03 07:03 UTC
From: m dot lindeman at pictura-dp dot nl Assigned: avb
Status: Closed Package: HTML_QuickForm
PHP Version: Irrelevant OS: Kubuntu linux
Roadmaps: (Not assigned)    
Subscription  


 [2005-10-17 07:37 UTC] m dot lindeman at pictura-dp dot nl
Description: ------------ in method loadDBResult of class HTML_QuickForm_select there is no support for fetchmode DB_FETCHMODE_OBJECT when $textCol=null and $valueCol=null. Test script: --------------- <?php $db = DB::Connect('mysql://user:passwd@host/dbname'); $db->setFetchMode(DB_FETCHMODE_OBJECT); $rs = &$db->Query('SELECT COL1, COL2 FROM table'); $form = new HTML_QuickForm(); $select = &$form->createElement('select'); $select->loadDbResult($rs); $form->display(); ?> Expected result: ---------------- <form ....> <select> <option value="row1__value">row1_text</option> ... </select> </form> Actual result: -------------- <form ....> <select></select> </form>

Comments

 [2005-11-01 06:37 UTC] avb
Hmm... Indeed the selection of fetchMode is broken: $fetchMode = ($textCol && $valueCol) ? DB_FETCHMODE_ASSOC : DB_FETCHMODE_DEFAULT; Should be instead: $fetchMode = ($textCol && $valueCol) ? DB_FETCHMODE_ASSOC : DB_FETCHMODE_ORDERED;
 [2006-06-03 07:03 UTC] avb (Alexey Borzov)
This bug has been fixed in CVS. 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.