create table data_service (
id int primary key not null auto_increment,
s_name varchar(255) not null,
cate_kind varchar(255),
waribiki varchar(255),
s_comment text,
s_types enum,
s_area text,
s_url varchar(255),
s_img varchar(255),
s_limit date,
s_lcome text,
a_comment text,
sample enum,
s_new enum,
ad_cate enum,
chain tinyint unsigned,
outlet enum,
add_data datetime not null,
edit_data timestamp,
s_flag tinyint unsigned,
out_order int
);
エラー文:ERROR 1064 (42000): You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near'
s_area textから下全て。s_area text以降を消すとテーブルは作れます。
MYSQLをさわって一週間ほどの素人ですが、原因が全然わかりません。
なぜかこのテーブルだけ・・・いろいろ試してはみたのですが・・・
原因が特定できそうな方、よろしくお願いします。
enumの使い方が違います
s_types enum,
では無く
s_types enum('type1','type2',type3'),
こんな感じです
enumの使い方が違います
s_types enum,
では無く
s_types enum('type1','type2',type3'),
こんな感じです
無事に作成できました!
ありがとうございます!
こんばんは。
こちらのMySQL環境で試しましたが、enumで指定している行でエラーになっているようです。
enumの行をことごとく外してSQLを実行したらテーブルを作成できます。
http://dev.mysql.com/doc/refman/4.1/ja/create-table.html
ENUM の場合、デフォルト値は最初の列挙値になる。
http://dev.mysql.com/doc/refman/5.1/ja/constraint-enum.html
ENUMカラムには常にデフォルト値があります。
CREATE TABLE構文で、enumを指定するときには値を列挙しなければならないようですが、これが原因ではないでしょうか?
無事に作成できました!
ありがとうございます!
無事に作成できました!
ありがとうございます!