PHP3 compatibility

This commit is contained in:
Loïc Chapeaux
2002-04-28 16:41:09 +00:00
parent 8ba7794043
commit d22c273acc
2 changed files with 9 additions and 6 deletions

View File

@@ -575,6 +575,7 @@ if (!defined('PMA_BUILD_DUMP_LIB_INCLUDED')){
for ($i = 0; $row = mysql_fetch_array($result, MYSQL_ASSOC); $i++) {
$columns[$i] = $row['Field'];
}
$columns_cnt = count($columns);
unset($i);
mysql_free_result($result);
$local_query = 'SELECT * FROM ' . PMA_backquote($db) . '.' . PMA_backquote($table);
@@ -582,8 +583,9 @@ if (!defined('PMA_BUILD_DUMP_LIB_INCLUDED')){
$buffer = ' <!-- ' . $GLOBALS['strTable'] . ' ' . $table . ' -->' . $crlf;
while ($record = mysql_fetch_array($result, MYSQL_ASSOC)) {
$buffer .= ' <' . $table . '>' . $crlf;
foreach ($columns as $column) {
if ($record[$column]!=NULL) {
for ($i = 0; $i < $columns_cnt; $i++) {
// There is no way to dectect a "NULL" value with PHP3
if (!function_exists('is_null') || !is_null($record[$column[$i]])) {
$buffer .= ' <' . $column . '>' . htmlspecialchars($record[$column])
. '</' . $column . '>' . $crlf;
}

View File

@@ -273,7 +273,7 @@ else {
// 'xml' case
else if ($GLOBALS['what'] == 'xml') {
// first add the xml tag
$dump_buffer .= '<?xml version="1.0" encoding="' . $charset . '"?>' . $crlf . $crlf;
$dump_buffer .= '<?xml version="1.0" encoding="' . $charset . '"?>' . $crlf . $crlf;
// some comments
$dump_buffer .= '<!--' . $crlf
. '-' . $crlf
@@ -304,13 +304,14 @@ else {
if (!isset($single)) {
$table = mysql_tablename($tables, $i);
}
if (isset($tmp_select) && is_int(strpos($tmp_select, '|' . $table . '|'))) {
if (isset($tmp_select) && strpos($tmp_select, ' |' . $table . '|')) {
$dump_buffer .= PMA_getTableXML($db, $table, $crlf, $err_url) . $crlf;
}
$i++;
}
$dump_buffer .= '</' . $db . '>';
}
$dump_buffer .= '</' . $db . '>' . $crlf;
} // end 'xml' case
// 'csv' case
else {
// Handles the EOL character