CodeIgniter Forums
SQL_CACH with CI DB active_record helpers - 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: SQL_CACH with CI DB active_record helpers (/showthread.php?tid=3773)



SQL_CACH with CI DB active_record helpers - El Forum - 10-21-2007

[eluser]dreamynsx[/eluser]
okay so:

$query = $this->db->get('mytable');

// Produces: SELECT * FROM mytable


Now, with Mysql query cache mechanism, type set to 2,
you can define which queries are to be inserted into the cache
by placing 'SQL_CACHE' right after the 'SELECT', like this:

$sql = "SELECT SQL_CACHE FROM mytable"

Does CI's active_record db helpers support this ability?

Or we have to build the query manually using the db->query like...
$this->db->query($sql);


SQL_CACH with CI DB active_record helpers - El Forum - 10-21-2007

[eluser]Michael Wales[/eluser]
CodeIgniter implements it's own version of query caching. If you would like to use SQL_CACHE you will need to manually build your queries.

CI Database Caching