diff options
Diffstat (limited to 'include/dblayer')
-rw-r--r-- | include/dblayer/functions_mysql.inc.php | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/include/dblayer/functions_mysql.inc.php b/include/dblayer/functions_mysql.inc.php index dbc66d503..785e588e0 100644 --- a/include/dblayer/functions_mysql.inc.php +++ b/include/dblayer/functions_mysql.inc.php @@ -416,8 +416,14 @@ UPDATE '.$tablename.' * @param array inserts * @return void */ -function mass_inserts($table_name, $dbfields, $datas) +function mass_inserts($table_name, $dbfields, $datas, $options=array()) { + $ignore = ''; + if (isset($options['ignore']) and $options['ignore']) + { + $ignore = 'IGNORE'; + } + if (count($datas) != 0) { $first = true; @@ -438,7 +444,7 @@ function mass_inserts($table_name, $dbfields, $datas) if ($first) { $query = ' -INSERT INTO '.$table_name.' +INSERT '.$ignore.' INTO '.$table_name.' ('.implode(',', $dbfields).') VALUES'; $first = false; |