fixed bug #489440 - enum fields in tbl_properties.php

This commit is contained in:
Loïc Chapeaux
2001-12-06 21:10:53 +00:00
parent 8f05aa6be7
commit 351b5b350c
4 changed files with 31 additions and 23 deletions

View File

@@ -253,11 +253,11 @@ while ($row = mysql_fetch_array($fields_rs)) {
$type = $row['Type'];
// reformat mysql query output - staybyte - 9. June 2001
$shorttype = substr($type, 0, 3);
if ($shorttype == 'set' || $shorttype == 'enu') {
$type = eregi_replace(',', ', ', $type);
// Removes automatic MySQL escape format
$type = str_replace('\'\'', '\\\'', $type);
// loic1: set or enum types: slashes single quotes inside options
if (eregi('^(set|enum)\((.+)\)$', $type, $tmp)) {
$tmp[2] = ereg_replace('([^,])\'([^,])', '\\1\\\'\\2', ',' . $tmp[2] . ',');
$tmp[2] = substr($tmp[2], 1, -1);
$type = $tmp[1] . '(' . str_replace(',', ', ', $tmp[2]) . ')';
$type_nowrap = '';
} else {
$type_nowrap = ' nowrap="nowrap"';