Undefined property: CI_DB_mysqli_driver::$ar_orderby? |
I have a CodeIgniter (version 3)
Message: Undefined property: CI_DB_mysqli_driver::$ar_orderby Filename: core/MY_Model.php Line Number: 38 Backtrace: File: /var/www/html/public/application/core/MY_Model.php Line: 38 Function: _error_handler Line Number: 38 and here you are if (!count($this->db->ar_orderby)) { $this->db->order_by($this->_order_by); } return $this->db->get($this->_table_name)->$method();
Because it's not "active record" ie "ar_orderby". It's "query builder" in CI3.
https://github.com/bcit-ci/CodeIgniter/b...r.php#L143
(05-29-2015, 12:33 PM)CroNiX Wrote: Because it's not "active record" ie "ar_orderby". It's "query builder" in CI3. But I didn't understant what i gonna do in this case
More than likely, you'll have to rewrite your code to handle this on its own. The ar_orderby property was undocumented, and not meant to be used in your application code. You usually have three options for something like this:
1. Set a property within your model when you add an order by clause (and reset that property when you execute a get/insert/update request). 2. Use the get_compiled_select() method to get the generated SQL and check for the order by clause there. 3. Write your code in a way that makes tracking the addition of an order by clause unnecessary. |
Welcome Guest, Not a member yet? Register Sign In |