我在編寫教程時編寫了一個查詢使用yii進行敏捷web應用程序開發。我試圖改變這個查詢表,並得到這個錯誤在phpmyadin第1行上的Mysql語法錯誤
ALTER TABLE 'tbl_issue' ADD CONSTRAINT 'FK_issue_project' FOREIGN KEY
('project_id') REFERENCES 'tbl_project' ('id') ON DELETE CASCADE ON
UPDATE RESTRICT
> #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 ''tbl_issue' ADD CONSTRAINT 'FK_issue_project' FOREIGN KEY
> ('project_id') REFERE' at line 1
誰能幫助嗎?
感謝您的回答。你能告訴更多一點嗎? –
非常感謝反引用:) –
是的,有時有點刺激。請記住,引用數據的字符串值用單引號('... where project_name ='Cool Project')'轉義。 – matthias