Skip to content

Commit

Permalink
Fixed issue #9181: When dumping database sometimes lines are left out
Browse files Browse the repository at this point in the history
  • Loading branch information
c-schmitz committed Sep 10, 2014
1 parent 2fde25c commit ba25136
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions application/helpers/admin/backupdb_helper.php
Expand Up @@ -145,7 +145,9 @@ function _outputTableData($sTableName, $oTableData, $bEchoOutput, $sFileName, $o
}

function _outputRecords($sTableName, $aFieldNames, $aRecords)
{
{
$sLastFieldName=end($aFieldNames);
$aLastRecord=end($aRecords);
$i=0;
$sOutput='';
foreach ($aRecords as $aRecord)
Expand All @@ -159,7 +161,7 @@ function _outputRecords($sTableName, $aFieldNames, $aRecords)
$sOutput=substr($sOutput,0,-1);
$sOutput.=") VALUES\n";
}
$sOutput.= '(';
$sOutput.= '(';
foreach ($aFieldNames as $sFieldName)
{

Expand All @@ -171,12 +173,12 @@ function _outputRecords($sTableName, $aFieldNames, $aRecords)
$sOutput.= 'NULL';
}

if (end($aFieldNames) != $sFieldName) {
if ($sFieldName != $sLastFieldName) {
$sOutput.= ', ';
}
}
$i++;
if ($i==200 || (end($aRecords) == $aRecord))
if ($i==200 || ($aLastRecord == $aRecord))
{
$sOutput.= ');' . "\n";
$i=0;
Expand Down

0 comments on commit ba25136

Please sign in to comment.