| Welcome to WebmasterWorld Guest from 184.108.40.206 |
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
|Become a Pro Member|
|Help me on Mysql|
I have this code,
INSERT INTO `newbus` ( 'busid' )
And i got this error message,
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 ''busid' ) VALUES (
)' at line 1
What seems to be the problem? Thanks
Try it without using quotes for table/column names:
INSERT INTO newbus (busid) VALUES ('3');
If busid is a numeric column, also remove the quotes from '3':
INSERT INTO newbus (busid) VALUES (3);
Have you tried to put a ; (semicolon) at thee end of the statement?
The way you do the statement (the pattern) is like this:
Insert into table_name
(columnName1, ColumnName2, ...)
Values (Value1, Value2, ...);
Your column names don't need to be quoted. If you want/need to quote the column names, use the back tick(`) instead.
INSERT INTO `newbus` ( busid )
INSERT INTO `newbus` ( `busid` )
Thanks, now i know my mistake. My eyes are not realy good in differentiating ( ' ) and ( ` ).
All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved