use reset()
parent
7bb8bf1da2
commit
90e54ce3f6
|
@ -661,7 +661,7 @@ class DatabaseMysql implements Database
|
||||||
{
|
{
|
||||||
$table = $this->tableNames[$table];
|
$table = $this->tableNames[$table];
|
||||||
}
|
}
|
||||||
$key = array_keys($rows[0]);
|
$key = array_keys(reset($rows));
|
||||||
foreach ($rows as &$r)
|
foreach ($rows as &$r)
|
||||||
{
|
{
|
||||||
$rs = array();
|
$rs = array();
|
||||||
|
@ -725,7 +725,7 @@ class DatabaseMysql implements Database
|
||||||
{
|
{
|
||||||
if (!is_array($rows))
|
if (!is_array($rows))
|
||||||
return false;
|
return false;
|
||||||
if (!is_array(@$rows[0]))
|
if (!is_array(reset($rows)))
|
||||||
$rows = array($rows);
|
$rows = array($rows);
|
||||||
$sql = $this->insert_builder($table, $rows, empty($options['REPLACE']), !empty($options['REPLACE']));
|
$sql = $this->insert_builder($table, $rows, empty($options['REPLACE']), !empty($options['REPLACE']));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue