naveendk.55 Posted May 9, 2012 Share Posted May 9, 2012 Hi I have a table as mentioned below. I am writing the below insert command and it is showing syntax error. Newbie. Please help if there is any mistake. insert into task (Desc, Total_Time, End_Date) values ('volks', '11:45:50', '2012-03-10'); mysql> desc task; +------------+--------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +------------+--------------+------+-----+---------+----------------+ | id | int(11) | NO | PRI | NULL | auto_increment | | Desc | varchar(225) | NO | | NULL | | | Total_Time | time | NO | | NULL | | | End_Date | date | NO | | NULL | | +------------+--------------+------+-----+---------+----------------+ 4 rows in set (0.03 sec) Quote Link to comment https://forums.phpfreaks.com/topic/262311-insert-issue/ Share on other sites More sharing options...
premiso Posted May 9, 2012 Share Posted May 9, 2012 Desc is a reserved word, either change the column name to something that is not reserved or use backticks ( ` ) around it. Next time post the error message as well. Quote Link to comment https://forums.phpfreaks.com/topic/262311-insert-issue/#findComment-1344257 Share on other sites More sharing options...
naveendk.55 Posted May 9, 2012 Author Share Posted May 9, 2012 Thank you Premiso. Have a wonderful time. Quote Link to comment https://forums.phpfreaks.com/topic/262311-insert-issue/#findComment-1344260 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.