|
@@ -17,6 +17,8 @@ class BxDevDb extends BxDolModuleDb {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function getQueryInsert($sTable, $aItems, $mixedComment = false, $aExclude = array('id')) {
|
|
function getQueryInsert($sTable, $aItems, $mixedComment = false, $aExclude = array('id')) {
|
|
|
|
|
+ bx_import('BxDevFunctions');
|
|
|
|
|
+
|
|
|
$bFirst = true;
|
|
$bFirst = true;
|
|
|
$sContent = $sComment = "";
|
|
$sContent = $sComment = "";
|
|
|
foreach($aItems as $aItem) {
|
|
foreach($aItems as $aItem) {
|
|
@@ -28,13 +30,19 @@ class BxDevDb extends BxDolModuleDb {
|
|
|
$aValues = array_values($aItem);
|
|
$aValues = array_values($aItem);
|
|
|
$iValues = count($aValues);
|
|
$iValues = count($aValues);
|
|
|
|
|
|
|
|
|
|
+ bx_import('BxDevFunctions');
|
|
|
|
|
+ foreach ($aValues as $iKey => $sValue)
|
|
|
|
|
+ $aValues[$iKey] = BxDevFunctions::dbAddSlashes($sValue, true);
|
|
|
|
|
+
|
|
|
if($bFirst) {
|
|
if($bFirst) {
|
|
|
$sContent .= "INSERT INTO `" . $sTable . "`(`" . implode("`, `", $aKeys) . "`) VALUES \n";
|
|
$sContent .= "INSERT INTO `" . $sTable . "`(`" . implode("`, `", $aKeys) . "`) VALUES \n";
|
|
|
$bFirst = false;
|
|
$bFirst = false;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
$sSql = "(" . implode(", ", array_fill(0, $iValues, "?")) . "),\n";
|
|
$sSql = "(" . implode(", ", array_fill(0, $iValues, "?")) . "),\n";
|
|
|
- $sContent .= call_user_func_array(array($this, 'prepare'), array_merge(array($sSql), $aValues));
|
|
|
|
|
|
|
+ $sSql = call_user_func_array(array($this, 'prepare'), array_merge(array($sSql), $aValues));
|
|
|
|
|
+
|
|
|
|
|
+ $sContent .= $sSql;
|
|
|
}
|
|
}
|
|
|
$sContent = substr($sContent, 0, -2) . ";\n\n";
|
|
$sContent = substr($sContent, 0, -2) . ";\n\n";
|
|
|
|
|
|