Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

INSERT INTO movie (id, title, desc, released, views, featured) VALUES ('', 'title', '

    description

', '2006-12-12', '0', '0')

error is

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 'desc, released, views, featured) VALUES ('', 'title', ' description ', ' at line 1

table structure is

id [ (pk, auto_inc) int(11) ]
title [ varchar(256) ]
desc [ text ]
released [ date ]
views [ int(11) ]
featured [ int(11) ]

running in phpmyadmin sql editor

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
290 views
Welcome To Ask or Share your Answers For Others

1 Answer

desc is a mysql reserved word. you must use backticks `` with the columns which are reserved words.

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

You should avoid using reserved words as column name or must use backticks (``)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...