Home » Database » DB_QueryTool » Bug #7580
getOne
Details
| Request #7580 | getOne |
|---|---|
| Submitted | 2006-05-08 18:06 UTC |
| From | deelight at f-m dot fm |
| Assigned | quipo |
| Status | Closed |
| Package | DB_QueryTool |
| PHP Version | 5.1.2 |
| OS | Windows XP |
| Roadmaps | (Not assigned) |
Comments
[2006-05-08 18:06 UTC] deelight at f-m dot fm
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
[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());