#1054 - Unknown column

23,548

Solution 1

You must surround any strings with quotes.

INSERT INTO `example`(`id`, `name`, `password`) 
VALUES               (1,'User Name','Password123')

Solution 2

You have to add '' for we and probably for password:

INSERT INTO `example`(`id`, `name`, `password`) VALUES (1,'we','5')

because both values are char type.

Share:
23,548
Admin
Author by

Admin

Updated on October 25, 2020

Comments

  • Admin
    Admin over 3 years

    I am using MySQL 5.5 and phpmyadmin 3.5.2 (provided by http://www.freewebhostingarea.com)

    My sql query is:

    INSERT INTO `example`(`id`, `name`, `password`) VALUES (1,we,5)
    

    where id is int type, name and password are varchar.

    but when ever inserting any value other than integer in name and age,it displays #1054 error, i.e

    #1054 - Unknown column 'we' in 'field list'