Search code examples
mysqlmysql-error-1054

#1054 - Unknown column in 'field list' Is minus sign a special character in MySQL?


Trying to insert some data:

INSERT INTO `ps_product_check`(`id_product`, `name`, `catalog`)     
VALUES  (30767,'CT39-235126','79926330')

The error is

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

Why does it think CT39 is supposed to be a column when it is (a part) of a value? How to get around this error?


Solution

  • I run your query and it works very fine.

    INSERT INTO `ps_product_check`(`id_product`, `name`, `catalog`)     
    VALUES  (30767,'CT39-235126','79926330')
    

    It is possible that you have placed other quotes (backticks) in the query executed.

    If I change the quotes like

    INSERT INTO `ps_product_check`(`id_product`, `name`, `catalog`)     
    VALUES  (30767,`CT39-235126`,'79926330')
    

    I get the same error.