From 39b622db9bda38282a32bb45623da63efe685729 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Wed, 16 Jan 2008 21:10:09 +0000 Subject: Many new Active Record functions, and another whack of stuff --- system/database/drivers/mysqli/mysqli_utility.php | 77 ++++++++++------------- 1 file changed, 34 insertions(+), 43 deletions(-) (limited to 'system/database/drivers/mysqli/mysqli_utility.php') diff --git a/system/database/drivers/mysqli/mysqli_utility.php b/system/database/drivers/mysqli/mysqli_utility.php index c904e92d7..1d910638f 100644 --- a/system/database/drivers/mysqli/mysqli_utility.php +++ b/system/database/drivers/mysqli/mysqli_utility.php @@ -24,47 +24,6 @@ */ class CI_DB_mysqli_utility extends CI_DB_utility { - /** - * Create database - * - * @access private - * @param string the database name - * @return bool - */ - function _create_database($name) - { - return "CREATE DATABASE ".$name; - } - - // -------------------------------------------------------------------- - - /** - * Drop database - * - * @access private - * @param string the database name - * @return bool - */ - function _drop_database($name) - { - return "DROP DATABASE ".$name; - } - - // -------------------------------------------------------------------- - - /** - * Drop Table - * - * @access private - * @return bool - */ - function _drop_table($table) - { - return "DROP TABLE IF EXISTS ".$this->db->_escape_table($table); - } - - // -------------------------------------------------------------------- - /** * List databases * @@ -187,9 +146,10 @@ class CI_DB_mysqli_utility extends CI_DB_utility { $is_int = array(); while ($field = mysqli_fetch_field($query->result_id)) { + // Most versions of MySQL store timestamp as a string $is_int[$i] = (in_array( strtolower(mysql_field_type($query->result_id, $i)), - array('tinyint', 'smallint', 'mediumint', 'int', 'bigint', 'timestamp'), + array('tinyint', 'smallint', 'mediumint', 'int', 'bigint'), // 'timestamp'), TRUE) ) ? TRUE : FALSE; @@ -255,8 +215,39 @@ class CI_DB_mysqli_utility extends CI_DB_utility { return $output; } + /** + * + * The functions below have been deprecated as of 1.6, and are only here for backwards + * compatibility. They now reside in dbforge(). The use of dbutils for database manipulation + * is STRONGLY discouraged in favour if using dbforge. + * + */ + + /** + * Create database + * + * @access private + * @param string the database name + * @return bool + */ + function _create_database($name) + { + return "CREATE DATABASE ".$name; + } + + // -------------------------------------------------------------------- + /** + * Drop database + * + * @access private + * @param string the database name + * @return bool + */ + function _drop_database($name) + { + return "DROP DATABASE ".$name; + } } - ?> \ No newline at end of file -- cgit v1.2.3-24-g4f1b