From 27bc61fdc2c031854d458cde1ad500db18f0468e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Chapeaux?= Date: Thu, 12 Jul 2001 21:57:26 +0000 Subject: [PATCH] Fixed some inconsistencies in the cvs export feature --- ChangeLog | 3 ++ lib.inc.php3 | 75 ++++++++++++++++++++++++++++++--------------- tbl_dump.php3 | 32 ++++++++++++++----- tbl_properties.php3 | 4 +-- 4 files changed, 81 insertions(+), 33 deletions(-) diff --git a/ChangeLog b/ChangeLog index b13b47f4a..c83f2dac7 100755 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,9 @@ $Source$ * Documentation.html: added a FAQ entry about upload errors 2001-07-12 Loïc Chapeaux + * tbl_dump.php3, lines 64-93; lib.inc.php3, lines 722-774; + tbl_properties.php3, line 612: fixed some inconsistencies in the + csv export feature. * tbl_properties.php3: fixed an IE5.0 display bug and an other one with Mozilla. * lib.inc.php3, line 969: fixed a wrong comparaison. diff --git a/lib.inc.php3 b/lib.inc.php3 index b7c2bf5a4..f4eea5b34 100755 --- a/lib.inc.php3 +++ b/lib.inc.php3 @@ -718,34 +718,61 @@ function count_records($db, $table) echo number_format($num, 0, $GLOBALS['number_decimal_separator'], $GLOBALS['number_thousands_separator']); } -// Get the content of $table as a CSV output. -// $sep contains the separation string. -// After every row, a custom callback function $handler gets called. -// $handler must accept one parameter ($sql_insert); + +/** + * Output the content of a table in CSV format + * + * @param string the database name + * @param string the table name + * @param string the separation string + * @param string the handler (function) to call. It must accept one parameter + * ($sql_insert) + * + * @return boolean always true + */ function get_table_csv($db, $table, $sep, $handler) { - $result = mysql_query("SELECT * FROM ".db_name($db)."." . - tbl_name($table)) or mysql_die(); - $i = 0; - while($row = mysql_fetch_row($result)) - { - @set_time_limit(60); // HaRa - $schema_insert = ""; - for($j=0; $j  ->    - +     - +