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

Bug #14850 order by direction inside of backticks
Submitted: 2008-10-22 08:53 UTC Modified: 2008-11-10 10:13 UTC
From: wlp1979 Assigned: quipo
Status: Closed Package: DB_QueryTool (version 1.1.2)
PHP Version: 5.2.6 OS: Linux 2.4
Roadmaps: (Not assigned)    
Subscription  


 [2008-10-22 08:53 UTC] wlp1979 (Lee Parker)
Description: ------------ When the order for a column is set to DESC, and the backticks are added around the column name, the DESC is getting included inside the backticks. Test script: --------------- <?php require_once 'DB/QueryTool.php'; $dsn = 'mysql://user:pass@server/db'; $Query = new DB_QueryTool_Query($dsn); $Query->setTable('users'); $Query->setSelect('user_id'); $Query->addSelect('username'); $Query->setOrder('user_id', true); $Query->setLimit(0,1); $sql = $Query->getQueryString(); echo $sql, "\n"; Expected result: ---------------- SELECT `user_id`,`username` FROM `users` ORDER BY `users`.`user_id` DESC LIMIT 0, 1 Actual result: -------------- SELECT `user_id`,`username` FROM `users` ORDER BY `users`.`user_id DESC` LIMIT 0, 1

Comments

 [2008-10-25 00:54 UTC] doconnor (Daniel O'Connor)
See also: Bug #14862
 [2008-11-09 13:53 UTC] quipo (Lorenzo Alberton)
Please try the CVS version.
 [2008-11-10 10:13 UTC] wlp1979 (Lee Parker)
Thanks for the fix.