diff options
author | Phil Sturgeon <email@philsturgeon.co.uk> | 2011-11-08 15:49:24 +0100 |
---|---|---|
committer | Phil Sturgeon <email@philsturgeon.co.uk> | 2011-11-08 15:51:17 +0100 |
commit | 3b3782a8e039f70379afd775a2155b8b1ae1334d (patch) | |
tree | 7e73b429ac2f50fe1f94110a2d9b5468c5d110a1 /system/database | |
parent | 3485f7e2f14a7f96e348d3c927ee256c8d290027 (diff) |
Added ->db->replace() for MySQLi.
Diffstat (limited to 'system/database')
-rw-r--r-- | system/database/drivers/mysqli/mysqli_driver.php | 19 |
1 files changed, 19 insertions, 0 deletions
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 * |