Reputation: 1
I created a table in mySQL database 'payroll' as:
CREATE TABLE `users` (
`userName` varchar(15) NOT NULL,
`password` varchar(15) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
I'm getting error
1054(Unknown column 'Imran' in the 'field list')
on following line of code:
insert into payroll.users SET userName=Imran
Upvotes: 1
Views: 337
Reputation: 34294
the word Imran should be encapsulated by '-s to mark it's a string.
insert into payroll.users SET userName='Imran'
Upvotes: 1