Can't use column name “desc” in mysql

后端 未结 3 477
滥情空心
滥情空心 2020-12-07 02:27
INSERT INTO movie (id, title, desc, released, views, featured) VALUES (\'\', \'title\', \'
\\r\\n    description
\\r\\n\', \'2006-12-12\', \'0\', \'0\')
3条回答
  •  天涯浪人
    2020-12-07 02:38

    The word desc is a reserved word and must be in backticks when used as a column name.

    INSERT INTO movie (id, title, `desc`, released, views, featured) VALUES
    -- ...etc...
    

    I'd also advise you not to use desc as a column name in future as it is confusing and will just cause problems. You could use description instead, for example.

提交回复
热议问题