Search code examples
mysqlinsertmysql-error-1054

Why the insert data (value) treated as column name ? #1054 - Unknown column


 INSERT INTO users(`username`, `password`, `location`, `aboutusr`, `gender`) 
 VALUES (`b`,`c`,`d`,`e`,`f`,`h`) 

The above query returns the error:

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


Solution

  • Except numerical, you need to include values inside single quotes.

    INSERT INTO users(username,password,location,aboutusr,gender)
    VALUES ('b','c','d','e','f','h');