CodeIgniter Forums
Order by Caching is not working - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Development (https://forum.codeigniter.com/forum-6.html)
+--- Forum: Issues (https://forum.codeigniter.com/forum-19.html)
+--- Thread: Order by Caching is not working (/thread-71275.html)



Order by Caching is not working - mandeep242 - 07-25-2018

I upgrade to Codeigniter 3.1.9 from 3.1.4, in codeigniter 3.1.4 my order_by is working under cache, but not in 3.1.9, I checked change log there is not mentioned that it is removed or not.


example code:

$this->db->start_cache();
$this->db->order_by("COL", "DESC");
$this->db->stop_cache();


$this->db->get("MYTABLE")


RE: Order by Caching is not working - php_rocs - 07-26-2018

@mandeep242,

Did you check the error log to see if any errors where thrown?


RE: Order by Caching is not working - mandeep242 - 07-26-2018

(07-26-2018, 09:04 AM)php_rocs Wrote: @mandeep242,

Did you check the error log to see if any errors where thrown?

yes I checked there is no error thrown.


RE: Order by Caching is not working - php_rocs - 07-27-2018

@mandeep242,

If you remove the cache start and stop does the order by start working again?


RE: Order by Caching is not working - mandeep242 - 07-29-2018

(07-27-2018, 06:08 AM)php_rocs Wrote: @mandeep242,

If you remove the cache start and stop does the order by start working again?

I checked again the code, there is count_all_results() added, in CI 3.1.4 it is ok, but in 3.1.9 after count_all_results is removing order by


RE: Order by Caching is not working - php_rocs - 07-30-2018

@mandeep242,

How are you sure the cache is not working?


RE: Order by Caching is not working - mandeep242 - 07-30-2018

(07-30-2018, 09:24 AM)php_rocs Wrote: @mandeep242,

How are you sure the cache is not working?

I checked by printing $this->db->last_query();


RE: Order by Caching is not working - php_rocs - 07-30-2018

@mandeep242,

What did or didn't you see?