Query Builder Order By |
I'm trying to delete the oldest X number of records within my MYSQL database. But it appears that the query builder is not including the order_by into the query.
Code: $this->db->from($table); This is the query from 'last_query' DELETE FROM `store_page_data` WHERE `store_page_id` = '123' AND `type` = 'DRAFT' AND `client_id` = '1' LIMIT 1 If I run the query manually with order by, it works. DELETE FROM `store_page_data` WHERE `store_page_id` = '123' AND `type` = 'DRAFT' AND `client_id` = '1' ORDER BY `last_changed` ASC LIMIT 1 I've check the documentation from the query builder and I can't see a reason why it's not being included. Any Ideas? |
Messages In This Thread |
Query Builder Order By - by adampwe - 05-26-2019, 04:30 AM
RE: Query Builder Order By - by php_rocs - 05-26-2019, 09:16 AM
RE: Query Builder Order By - by dave friend - 05-26-2019, 09:23 AM
|