From 9b3e7b5f2d4ec4feae793ef90454506addbb19e1 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Mon, 4 Feb 2008 23:20:34 +0000 Subject: Added and documented Active Record caching. Made AR fully database-prefix aware --- system/database/drivers/mysqli/mysqli_driver.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'system/database/drivers/mysqli/mysqli_driver.php') diff --git a/system/database/drivers/mysqli/mysqli_driver.php b/system/database/drivers/mysqli/mysqli_driver.php index b2e97f927..9e7cc0c9f 100644 --- a/system/database/drivers/mysqli/mysqli_driver.php +++ b/system/database/drivers/mysqli/mysqli_driver.php @@ -448,6 +448,13 @@ class CI_DB_mysqli_driver extends CI_DB { // we may need "`item1` `item2`" and not "`item1 item2`" if (ctype_alnum($item) === FALSE) { + if (strpos($item, '.') !== FALSE) + { + $aliased_tables = implode(".",$this->ar_aliased_tables).'.'; + $table_name = substr($item, 0, strpos($item, '.')+1); + $item = (strpos($aliased_tables, $table_name) !== FALSE) ? $item = $item : $this->dbprefix.$item; + } + // This function may get "field >= 1", and need it to return "`field` >= 1" $lbound = ($first_word_only === TRUE) ? '' : '|\s|\('; -- cgit v1.2.3-24-g4f1b