diff options
author | ondrej.zara <none@none> | 2011-02-04 12:31:30 +0000 |
---|---|---|
committer | ondrej.zara <none@none> | 2011-02-04 12:31:30 +0000 |
commit | c9bb3bf87c1cd59b82768ab58c3be111820aba78 (patch) | |
tree | c7a69e1291650412175168b65352912619199edf /backend/php-mysql | |
parent | f819c4b3e9d55c6c19aa664601f954dce2a3c073 (diff) | |
download | wwwsqldesigner-c9bb3bf87c1cd59b82768ab58c3be111820aba78.zip wwwsqldesigner-c9bb3bf87c1cd59b82768ab58c3be111820aba78.tar.gz wwwsqldesigner-c9bb3bf87c1cd59b82768ab58c3be111820aba78.tar.bz2 |
closes issue #98
--HG--
extra : convert_revision : svn%3Ab267cdba-c1da-11dd-874b-8bacd04a0a74/trunk%40117
Diffstat (limited to 'backend/php-mysql')
-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.'">'; |