當我在phpmyadmin中運行以下命令。mysql命令有什麼問題?
CREATE TABLE subscribers (
'subscriber_id' int(11) NOT NULL auto_increment,
'customers_id' int(11) default NULL,
'email_address' varchar(96) NOT NULL default '',
'email_format' varchar(4) NOT NULL default 'TEXT',
PRIMARY KEY ('subscriber_id')
) TYPE=MyISAM;
它顯示我#1064 - 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 ''subscriber_id' int(11) NOT NULL auto_increment, 'customers_id' int(11) defaul' at line 2
INSERT INTO query_builder (query_id, query_category, query_name, query_description, query_string, query_keys_list) VALUES (6, 'email,newsletters', 'All Newsletter Subscribers', 'Returns name and email address of all Customer Account subscribers and all Newsletter-Only subscribers.', 'select c.customers_firstname, c.customers_lastname, s.email_address as customers_email_address from TABLE_SUBSCRIBERS as s left join TABLE_CUSTOMERS as c on c.customers_id = s.customers_id ', '')
它表明: 1062 - 重複條目 '6' 關鍵1
我掉下來的命令是正確的。我不知道如何糾正它?謝謝。
我刪除了單引號,它仍然顯示#1064 - 你的SQL語法錯誤;檢查與您的MySQL服務器版本相對應的手冊,以在''subscriber_id''附近使用正確的語法))TYPE = MyISAM'在第6行 – down321 2012-01-09 09:23:22
@hsz:謝謝... @ down321:查看更新後的答案。我忘了從'PRIMARY KEY(subscriber_id)'中刪除單引號 – 2012-01-09 09:23:24