Merge pull request #376 from ayusun/bug3910

Bug fix 3910. Updated Export plugin to support zero rows
This commit is contained in:
Marc Delisle 2013-05-14 11:08:04 -07:00
commit f1df54b99c
2 changed files with 9 additions and 7 deletions

View File

@ -33,6 +33,7 @@ values
- bug #3916 [interface] Missing scrollbar (original theme)
+ [vendor] add tcpdf path to vendor_config.php
- bug fix compat with tcpdf >= 6.0 (tested with 6.0.012)
- bug #3910 Export database with empty table as a php array, does not produce valid PHP
4.0.0.0 (2013-05-03)
+ Patch #3481047 for rfe #3480477 Insert as new row enhancement

View File

@ -191,16 +191,17 @@ class ExportPhparray extends ExportPlugin
$buffer = '';
$record_cnt = 0;
// Output table name as comment
$buffer .= $crlf . '// '
. PMA_Util::backquote($db) . '.'
. PMA_Util::backquote($table) . $crlf;
$buffer .= '$' . $tablefixed . ' = array(';
while ($record = PMA_DBI_fetch_row($result)) {
$record_cnt++;
// Output table name as comment if it's the first record of the table
if ($record_cnt == 1) {
$buffer .= $crlf . '// '
. PMA_Util::backquote($db) . '.'
. PMA_Util::backquote($table) . $crlf;
$buffer .= '$' . $tablefixed . ' = array(' . $crlf;
$buffer .= ' array(';
$buffer .= $crlf . ' array(';
} else {
$buffer .= ',' . $crlf . ' array(';
}
@ -223,4 +224,4 @@ class ExportPhparray extends ExportPlugin
return true;
}
}
?>
?>