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++) { for ($i = 0; $row = mysql_fetch_array($result, MYSQL_ASSOC); $i++) {
$columns[$i] = $row['Field']; $columns[$i] = $row['Field'];
} }
$columns_cnt = count($columns);
unset($i); unset($i);
mysql_free_result($result); mysql_free_result($result);
$local_query = 'SELECT * FROM ' . PMA_backquote($db) . '.' . PMA_backquote($table); $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; $buffer = ' <!-- ' . $GLOBALS['strTable'] . ' ' . $table . ' -->' . $crlf;
while ($record = mysql_fetch_array($result, MYSQL_ASSOC)) { while ($record = mysql_fetch_array($result, MYSQL_ASSOC)) {
$buffer .= ' <' . $table . '>' . $crlf; $buffer .= ' <' . $table . '>' . $crlf;
foreach ($columns as $column) { for ($i = 0; $i < $columns_cnt; $i++) {
if ($record[$column]!=NULL) { // 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]) $buffer .= ' <' . $column . '>' . htmlspecialchars($record[$column])
. '</' . $column . '>' . $crlf; . '</' . $column . '>' . $crlf;
} }

View File

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