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

Bug #7213 PDO->fetchAll() Params in queryAll()
Submitted: 2006-03-27 08:39 UTC
From: marc dot jakubowski at gmail dot com Assigned: lsmith
Status: Closed Package: LiveUser_Admin (version 0.3.7)
PHP Version: 5.1.1 OS: XP
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 : 34 + 15 = ?

 
 [2006-03-27 08:39 UTC] marc dot jakubowski at gmail dot com (Marc Jakubowski)
Description: ------------ When using PDO as storage and calling the get*() methods without parameters or with array('select' => 'all') to fetch all Groups, Rights etc the method queryAll() in Admin/Storage/PDO.php is called and $stmt->fetchAll(PDO::FETCH_ASSOC|PDO::FETCH_COLUMN|PDO::FETCH_GROUP); is executed but it will only return the first columns as a numeric array instead of all columns in an associated array. When removing the "|PDO::FETCH_COLUMN|PDO::FETCH_GROUP" part so that only PDO::FETCH_ASSOC is used, everything works fine. Test script: --------------- $admin->perm->getGroups(); Expected result: ---------------- array(2) { [0] => array(3) { ["group_id"] => string(1) "1" ["group_type"] => string(1) "1" ["group_define_name"] => string(4) "Member" } [1] => array(3) { ["group_id"] => string(1) "2" ["group_type"] => string(1) "1" ["group_define_name"] => string(4) "Admin" } } Actual result: -------------- array(2) { [1] => array(1) { [0] => string(1) "1" } [2] => array(1) { [0] => string(1) "1" } }

Comments

 [2006-03-27 09:33 UTC] lsmith (Lukas Smith)
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.