mirror of
https://github.com/e107inc/e107.git
synced 2025-04-20 04:32:01 +02:00
Support for 'IGNORE' duplicate key on INSERT.
This commit is contained in:
parent
ed36008286
commit
c7c3c49daf
@ -867,6 +867,7 @@ class e_db_mysql
|
||||
$this->mySQLcurTable = $table;
|
||||
$REPLACE = false; // kill any PHP notices
|
||||
$DUPEKEY_UPDATE = false;
|
||||
$IGNORE = '';
|
||||
|
||||
if(is_array($arg))
|
||||
{
|
||||
@ -885,7 +886,12 @@ class e_db_mysql
|
||||
{
|
||||
$DUPEKEY_UPDATE = true;
|
||||
unset($arg['_DUPLICATE_KEY_UPDATE']);
|
||||
}
|
||||
|
||||
if(isset($arg['_IGNORE']))
|
||||
{
|
||||
$IGNORE = ' IGNORE';
|
||||
unset($arg['_IGNORE']);
|
||||
}
|
||||
|
||||
if(!isset($arg['_FIELD_TYPES']) && !isset($arg['data']))
|
||||
@ -942,7 +948,7 @@ class e_db_mysql
|
||||
|
||||
if($REPLACE === false)
|
||||
{
|
||||
$query = "INSERT INTO `".$this->mySQLPrefix."{$table}` ({$keyList}) VALUES ({$valList})";
|
||||
$query = "INSERT".$IGNORE." INTO `".$this->mySQLPrefix."{$table}` ({$keyList}) VALUES ({$valList})";
|
||||
|
||||
if($DUPEKEY_UPDATE === true)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user