From 3b3782a8e039f70379afd775a2155b8b1ae1334d Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Tue, 8 Nov 2011 14:49:24 +0000 Subject: Added ->db->replace() for MySQLi. --- system/database/drivers/mysqli/mysqli_driver.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'system') diff --git a/system/database/drivers/mysqli/mysqli_driver.php b/system/database/drivers/mysqli/mysqli_driver.php index 4af08c8a9..fb5953bd7 100644 --- a/system/database/drivers/mysqli/mysqli_driver.php +++ b/system/database/drivers/mysqli/mysqli_driver.php @@ -574,6 +574,25 @@ class CI_DB_mysqli_driver extends CI_DB { // -------------------------------------------------------------------- + + /** + * Replace statement + * + * Generates a platform-specific replace string from the supplied data + * + * @access public + * @param string the table name + * @param array the insert keys + * @param array the insert values + * @return string + */ + function _replace($table, $keys, $values) + { + return "REPLACE INTO ".$table." (".implode(', ', $keys).") VALUES (".implode(', ', $values).")"; + } + + // -------------------------------------------------------------------- + /** * Update statement * -- cgit v1.2.3-24-g4f1b