Jogi
Jogi

Reputation: 1

Error Code: 1054 in mySQL

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

Answers (1)

Shadow
Shadow

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

Related Questions