Bugfixing

This commit is contained in:
color.diff=auto 2021-03-26 15:52:19 -06:00
parent 1fd9f2165a
commit 855a1a4ba6

View File

@ -51,29 +51,29 @@ class D2Database {
$sql = '';
if (!empty($data)) {
foreach ($data as $d) {
$sql = "INSERT INTO `$tableName` (";
if (!empty($d)) {
$sql = "INSERT INTO `$tableName` (";
foreach ($d as $k => $v) {
$sql .= "`$k`" . ",";
}
}
$sql = rtrim($sql, ",");
$sql .= ") ";
}
}
}
$sql .= "VALUES ";
if (!empty($data)) {
foreach ($data as $d) {
$sql .= "(";
if (!empty($d)) {
$sql .= "(";
foreach ($d as $k => $v) {
$sql .= '"' . $v . '"' . ",";
}
}
$sql = rtrim($sql, ",");
$sql .= "), ";
}
}
$sql = rtrim($sql, ", ");
PDO_Execute($sql);
}