MySQL gives me syntax error for a simple query but I don't see any error. If you guys find any please help.
insert into cast(sid,celeb_id,type,name,prior)
values(30,1,1,'James Keziah Delaney',2)
It gives sql syntax error near cast.
The main cause of this error is that there is a function Cast in mysql.
It look like to call the cast() function.
You can choose one of the solutions to solve it.
look like this.
insert into `cast`(sid,celeb_id,type,name,prior) values(30,1,1,'James Keziah Delaney',2)
cast and ( let mysql know you did't want to execute Cast method. thank for @Barmar remind.Note:
I would suggest you don't give the table name from keyword or function name.
cast and (. Then it doesn't look like a function call.You can't insert into cast(). It requires a list of column names.
cast.