From 44dd0e8405c326d848e2982b76c23b6248c5edc4 Mon Sep 17 00:00:00 2001 From: ayusun Date: Mon, 13 May 2013 15:16:46 +0530 Subject: [PATCH 1/3] Bug fix 3910. Updated Export plugin to support zero rows --- libraries/plugins/export/ExportPhparray.class.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/libraries/plugins/export/ExportPhparray.class.php b/libraries/plugins/export/ExportPhparray.class.php index cbe5e2c039..d55143d82e 100644 --- a/libraries/plugins/export/ExportPhparray.class.php +++ b/libraries/plugins/export/ExportPhparray.class.php @@ -191,16 +191,17 @@ class ExportPhparray extends ExportPlugin $buffer = ''; $record_cnt = 0; + $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; } } -?> \ No newline at end of file +?> From 25e71b71dab323f8135ea1411d46de956413e054 Mon Sep 17 00:00:00 2001 From: ayusun Date: Tue, 14 May 2013 22:40:39 +0530 Subject: [PATCH 2/3] Bug fix #3910 with updated code indentation --- libraries/plugins/export/ExportPhparray.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/plugins/export/ExportPhparray.class.php b/libraries/plugins/export/ExportPhparray.class.php index d55143d82e..2d3b73c545 100644 --- a/libraries/plugins/export/ExportPhparray.class.php +++ b/libraries/plugins/export/ExportPhparray.class.php @@ -191,15 +191,15 @@ 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('; - + $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 . ' array('; } else { From 818e15bfc9dde6add60d087dc541fe68109f399d Mon Sep 17 00:00:00 2001 From: ayusun Date: Tue, 14 May 2013 22:54:41 +0530 Subject: [PATCH 3/3] Updated ChangeLog for bug #3910 --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index 0d5123cb2b..f2a956bc44 100644 --- a/ChangeLog +++ b/ChangeLog @@ -28,6 +28,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