MySQL error #1054 - Unknown column in 'Field List'

前端 未结 2 1900
感情败类
感情败类 2021-02-05 12:31

Whenever I try to input data into my tblorder I get the error message #1054 - Unknown column \'FK_Customer_ID\' in \'field list\'. I have tried breaking my code down and in doi

2条回答
  •  余生分开走
    2021-02-05 12:59

    You have an error in your OrderQuantity column. It is named "OrderQuantity" in the INSERT statement and "OrderQantity" in the table definition.

    Also, I don't think you can use NOW() as default value in OrderDate. Try to use the following:

     OrderDate TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
    

    Example Fiddle

提交回复
热议问题