';
$schema_insert .= '' . htmlspecialchars($GLOBALS['strField']) . ' | ';
$schema_insert .= '' . htmlspecialchars($GLOBALS['strType']) . ' | ';
$schema_insert .= '' . htmlspecialchars($GLOBALS['strNull']) . ' | ';
$schema_insert .= '' . htmlspecialchars($GLOBALS['strDefault']) . ' | ';
if ($do_relation && $have_rel) {
$schema_insert .= '' . htmlspecialchars($GLOBALS['strLinksTo']) . ' | ';
}
if ($do_comments && $cfgRelation['commwork']) {
$schema_insert .= '' . htmlspecialchars($GLOBALS['strComments']) . ' | ';
$comments = PMA_getComments($db, $table);
}
if ($do_mime && $cfgRelation['mimework']) {
$schema_insert .= '' . htmlspecialchars('MIME') . ' | ';
$mime_map = PMA_getMIME($db, $table, true);
}
$schema_insert .= '
';
if (!PMA_exportOutputHandler($schema_insert)) return FALSE;
while ($row = PMA_DBI_fetch_assoc($result)) {
$schema_insert = '';
$type = $row['Type'];
// reformat mysql query output - staybyte - 9. June 2001
// loic1: set or enum types: slashes single quotes inside options
if (eregi('^(set|enum)\((.+)\)$', $type, $tmp = array())) {
$tmp[2] = substr(ereg_replace('([^,])\'\'', '\\1\\\'', ',' . $tmp[2]), 1);
$type = $tmp[1] . '(' . str_replace(',', ', ', $tmp[2]) . ')';
$type_nowrap = '';
$binary = 0;
$unsigned = 0;
$zerofill = 0;
} else {
$type_nowrap = ' nowrap="nowrap"';
$type = eregi_replace('BINARY', '', $type);
$type = eregi_replace('ZEROFILL', '', $type);
$type = eregi_replace('UNSIGNED', '', $type);
if (empty($type)) {
$type = ' ';
}
$binary = eregi('BINARY', $row['Type'], $test = array());
$unsigned = eregi('UNSIGNED', $row['Type'], $test = array());
$zerofill = eregi('ZEROFILL', $row['Type'], $test = array());
}
$strAttribute = ' ';
if ($binary) {
$strAttribute = 'BINARY';
}
if ($unsigned) {
$strAttribute = 'UNSIGNED';
}
if ($zerofill) {
$strAttribute = 'UNSIGNED ZEROFILL';
}
if (!isset($row['Default'])) {
if ($row['Null'] != '') {
$row['Default'] = 'NULL';
}
} else {
$row['Default'] = $row['Default'];
}
$fmt_pre = '';
$fmt_post = '';
if (in_array($row['Field'], $unique_keys)) {
$fmt_pre = '' . $fmt_pre;
$fmt_post = $fmt_post . '';
}
if ($row['Key']=='PRI') {
$fmt_pre = '' . $fmt_pre;
$fmt_post = $fmt_post . '';
}
$schema_insert .= '' . $fmt_pre . htmlspecialchars($row['Field']) . $fmt_post . ' | ';
$schema_insert .= '' . htmlspecialchars($type) . ' | ';
$schema_insert .= '' . htmlspecialchars($row['Null'] == '' ? $GLOBALS['strNo'] : $GLOBALS['strYes']) . ' | ';
$schema_insert .= '' . htmlspecialchars(isset($row['Default']) ? $row['Default'] : '') . ' | ';
$field_name = $row['Field'];
if ($do_relation && $have_rel) {
$schema_insert .= '' . (isset($res_rel[$field_name]) ? htmlspecialchars($res_rel[$field_name]['foreign_table'] . ' (' . $res_rel[$field_name]['foreign_field'] . ')') : '') . ' | ';
}
if ($do_comments && $cfgRelation['commwork']) {
$schema_insert .= '' . ( isset($comments[$field_name]) ? htmlspecialchars($comments[$field_name]) : '') . ' | ';
}
if ($do_mime && $cfgRelation['mimework']) {
$schema_insert .= '' . ( isset($mime_map[$field_name]) ? htmlspecialchars(str_replace('_', '/', $mime_map[$field_name]['mimetype'])) : '') . ' | ';
}
$schema_insert .= '
';
if (!PMA_exportOutputHandler($schema_insert)) return FALSE;
} // end while
PMA_DBI_free_result($result);
return PMA_exportOutputHandler('