From c6ad0237eb6957046343ca654ab1c7d26787d466 Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Tue, 29 Jan 2008 18:44:54 +0000 Subject: Abstracted FROM table listing in Active Record for databases that do not support parenthetic grouping of tables to explicitly define operator precedence --- system/database/drivers/mysqli/mysqli_driver.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'system/database/drivers/mysqli') diff --git a/system/database/drivers/mysqli/mysqli_driver.php b/system/database/drivers/mysqli/mysqli_driver.php index d645cc820..b2e97f927 100644 --- a/system/database/drivers/mysqli/mysqli_driver.php +++ b/system/database/drivers/mysqli/mysqli_driver.php @@ -473,6 +473,28 @@ class CI_DB_mysqli_driver extends CI_DB { // -------------------------------------------------------------------- + /** + * From Tables + * + * This function implicitly groups FROM tables so there is no confusion + * about operator precedence in harmony with SQL standards + * + * @access public + * @param type + * @return type + */ + function _from_tables($tables) + { + if (! is_array($tables)) + { + $tables = array($tables); + } + + return '('.implode(', ', $tables).')'; + } + + // -------------------------------------------------------------------- + /** * Insert statement * -- cgit v1.2.3-24-g4f1b