Created
August 26, 2015 13:09
-
-
Save tuxis-ie/e079a216b63d5e0300c3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/includes/dbFacile.mysqli.php b/includes/dbFacile.mysqli.php | |
index 2408ca9..1cc3492 100644 | |
--- a/includes/dbFacile.mysqli.php | |
+++ b/includes/dbFacile.mysqli.php | |
@@ -65,7 +65,7 @@ function dbQuery($sql, $parameters=array()) { | |
* */ | |
-function dbInsert($data, $table) { | |
+function dbInsert($data, $table, $replace = false) { | |
global $fullSql, $database_link; | |
global $db_stats; | |
// the following block swaps the parameters if they were given in the wrong order. | |
@@ -79,7 +79,8 @@ function dbInsert($data, $table) { | |
// trigger_error('QDB - Parameters passed to insert() were in reverse order, but it has been allowed', E_USER_NOTICE); | |
} | |
- $sql = 'INSERT INTO `'.$table.'` (`'.implode('`,`', array_keys($data)).'`) VALUES ('.implode(',', dbPlaceHolders($data)).')'; | |
+ $cmd = ($replace === true ? 'REPLACE' : 'INSERT'); | |
+ $sql = $cmd.' INTO `'.$table.'` (`'.implode('`,`', array_keys($data)).'`) VALUES ('.implode(',', dbPlaceHolders($data)).')'; | |
$time_start = microtime(true); | |
dbBeginTransaction(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment