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

Request #7580 getOne
Submitted: 2006-05-08 18:06 UTC
From: deelight at f-m dot fm Assigned: quipo
Status: Closed Package: DB_QueryTool (version 1.0.3)
PHP Version: 5.1.2 OS: Windows 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 : 13 + 34 = ?

 
 [2006-05-08 18:06 UTC] deelight at f-m dot fm (Andrzej Kowalik)
Description: ------------ Unless I missed something, I don't think it's currently possible to do this. It would be very usefull to have something like DB's getOne to get the first column of the first row from a query result. Test script: --------------- $dbCategory->reset(); $dbCategory->setSelect('MAX(position)'); $res = $dbCategory->getOne(); // $res would contain the highest position

Comments

 [2006-05-08 18:15 UTC] deelight at f-m dot fm
forgot to mention, that right now, to achieve the result, I use DB's getOne combined with DB_QueryTool's getQueryString: $dbCategory->reset(); $dbCategory->setSelect('MAX(position)'); $res = $db->getOne($dbCategory->getQueryString());
 [2006-05-08 20:44 UTC] quipo (Lorenzo Alberton)
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. method added in CVS. Have fun.