"zero" value was exported as ''

This commit is contained in:
Loïc Chapeaux
2001-11-14 20:49:43 +00:00
parent b24c1aa4d1
commit bc54ef7d50

View File

@@ -209,7 +209,7 @@ if (!defined('__LIB_BUILD_DUMP__')){
for ($j = 0; $j < $fields_cnt; $j++) {
if (!isset($row[$j])) {
$values[] = 'NULL';
} else if ($row[$j] != '') {
} else if ($test == '0' || $test != '') {
// a number
if ($field_num[$j]) {
$values[] = $row[$j];
@@ -314,7 +314,7 @@ if (!defined('__LIB_BUILD_DUMP__')){
for ($j = 0; $j < $fields_cnt; $j++) {
if (!isset($row[$j])) {
$schema_insert .= ' NULL, ';
} else if ($row[$j] != '') {
} else if ($test == '0' || $test != '') {
$type = mysql_field_type($result, $j);
// a number
if ($type == 'tinyint' || $type == 'smallint' || $type == 'mediumint' || $type == 'int' ||
@@ -487,7 +487,7 @@ if (!defined('__LIB_BUILD_DUMP__')){
if (!isset($row[$j])) {
$schema_insert .= 'NULL';
}
else if ($row[$j] != '') {
else if ($test == '0' || $test != '') {
// loic1 : always enclose fields
if ($what == 'excel') {
$row[$j] = ereg_replace("\015(\012)?", "\012", $row[$j]);