diff options
Diffstat (limited to 'backend/php-mysql/index.php')
-rw-r--r-- | backend/php-mysql/index.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/backend/php-mysql/index.php b/backend/php-mysql/index.php index 89cb690..59b7e64 100644 --- a/backend/php-mysql/index.php +++ b/backend/php-mysql/index.php @@ -48,7 +48,13 @@ $type = $row["COLUMN_TYPE"]; $comment = (isset($row["COLUMN_COMMENT"]) ? $row["COLUMN_COMMENT"] : ""); $null = ($row["IS_NULLABLE"] == "YES" ? "1" : "0"); - $def = $row["COLUMN_DEFAULT"]; + + if (preg_match("/binary/i",$row["COLUMN_TYPE"])) { + $def = bin2hex($row["COLUMN_DEFAULT"]); + } else { + $def = $row["COLUMN_DEFAULT"]; + } + $ai = (preg_match("/auto_increment/i",$row["EXTRA"]) ? "1" : "0"); if ($def == "NULL") { $def = ""; } $xml .= '<row name="'.$name.'" null="'.$null.'" autoincrement="'.$ai.'">'; |