Пример #1
0
     $row['Type'] = '';
     $type = '';
 } else {
     $type = $row['Type'];
 }
 // set or enum types: slashes single quotes inside options
 if (preg_match('@^(set|enum)\\((.+)\\)$@i', $type, $tmp)) {
     $type = $tmp[1];
     $length = substr(preg_replace('@([^,])\'\'@', '\\1\\\'', ',' . $tmp[2]), 1);
 } else {
     // strip the "BINARY" attribute, except if we find "BINARY(" because
     // this would be a BINARY or VARBINARY field type
     $type = preg_replace('@BINARY([^\\(])@i', '', $type);
     $type = preg_replace('@ZEROFILL@i', '', $type);
     $type = preg_replace('@UNSIGNED@i', '', $type);
     $type_and_length = PMA_extract_type_length($type);
     $type = $type_and_length['type'];
     $length = $type_and_length['length'];
     unset($type_and_length);
 }
 // end if else
 // some types, for example longtext, are reported as
 // "longtext character set latin7" when their charset and / or collation
 // differs from the ones of the corresponding database.
 if (PMA_MYSQL_INT_VERSION >= 40100) {
     $tmp = strpos($type, 'character set');
     if ($tmp) {
         $type = substr($type, 0, $tmp - 1);
     }
 }
 if (isset($submit_length) && $submit_length != FALSE) {
Пример #2
0
        if ($cfgRelation['mimework'] && $cfg['BrowseMIME']) {
            $mime_map = PMA_getMIME($db, $table, true);
        }
    }
}
$rownum = 0;
$aryFields = array();
$checked = !empty($checkall) ? ' checked="checked"' : '';
$save_row = array();
$odd_row = true;
while ($row = PMA_DBI_fetch_assoc($fields_rs)) {
    $save_row[] = $row;
    $rownum++;
    $aryFields[] = $row['Field'];
    $type = $row['Type'];
    $type_and_length = PMA_extract_type_length($row['Type']);
    // reformat mysql query output - staybyte - 9. June 2001
    // loic1: set or enum types: slashes single quotes inside options
    if (preg_match('@^(set|enum)\\((.+)\\)$@i', $type, $tmp)) {
        $tmp[2] = substr(preg_replace('@([^,])\'\'@', '\\1\\\'', ',' . $tmp[2]), 1);
        $type = $tmp[1] . '(' . str_replace(',', ', ', $tmp[2]) . ')';
        // for the case ENUM('–','“')
        $type = htmlspecialchars($type);
        $type_nowrap = '';
        $binary = 0;
        $unsigned = 0;
        $zerofill = 0;
    } else {
        $type_nowrap = ' nowrap="nowrap"';
        // strip the "BINARY" attribute, except if we find "BINARY(" because
        // this would be a BINARY or VARBINARY field type