![]() |
Possible Bug in Active Record when ordering by aliased field - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Possible Bug in Active Record when ordering by aliased field (/showthread.php?tid=20439) |
Possible Bug in Active Record when ordering by aliased field - El Forum - 07-09-2009 [eluser]Unknown[/eluser] Working with Flexigrid in CI and think I may have uncovered a possible issue with Active Record in CI, specifically when dealing with order_by(). Trying to sort based on the columns in flexigrid. First off, here's the code from my model: Code: //Select table name Code: SELECT emp.uuid, emp.last_name, emp.first_name, emp.email, type.name as e_type However, if I click on the employee type column, I get the following error. Code: INFO - 2009-07-09 17:39:37 --> Query: SELECT emp.uuid, emp.last_name, emp.first_name, emp.email, type.name as e_type This query works fine when run in PHPMyAdmin. Only thing different in the two queries (from CI perspective is one sorts on last_name, one on employee_type.name (aliased to e_type). I've also tried passing in the full name (employee_types.name), the field alias (e_type) as well as table alias/name (type.name). None of them work from CI. Any ideas what is going on? More than willing to provide more code or information if needed. Thanks in advance! -DK |