不能在mysql中使用列名"desc"

Bil*_*lal 6 php mysql web

INSERT INTO movie (id, title, desc, released, views, featured) VALUES ('', 'title', '
\r\n    description
\r\n', '2006-12-12', '0', '0')
Run Code Online (Sandbox Code Playgroud)

错误是

1064 - 您的SQL语法出错; 查看与您的MySQL服务器版本对应的手册,以便在'desc,released,views,featured)附近使用正确的语法VALUES('','title','\ r \n description\r \n','at line 1

表结构是

id [ (pk, auto_inc) int(11) ]
title [ varchar(256) ]
desc [ text ]
released [ date ]
views [ int(11) ]
featured [ int(11) ]
Run Code Online (Sandbox Code Playgroud)

在phpmyadmin sql编辑器中运行

Sha*_*ngh 16

desc是一个mysql保留字.你必须使用反序词``和保留字的列.

INSERT INTO movie (id, title, `desc`, released, views, featured)...
Run Code Online (Sandbox Code Playgroud)

你应该避免使用保留字作为列名或必须使用反引号(``)