Search code examples
mysqlmysql-error-1054

MySQL Error Code 1054- inserting data is unsucessful


I need help with a MySQL program, this is the code:

INSERT INTO CUSTOMER (Customerid, CustomerFname, CustomerLname, CustomerPhone, CustomerGender, CustomerYearly_salary, CustomerStreet, CustomerCity, CustomerState, CustomerPostcode, ProductId, PaymentId)

VALUES (12345678910,’Anna’, ’English’, 017362930115, ‘female’, 30000, ‘Augsburger_Str._84‘, ‘Senscheid’, ‘Rheinland-Pfalz’, 53520, 0101, 50000)

This is the error code:

INSERT INTO CUSTOMER (Customerid, CustomerFname, CustomerLname, CustomerPhone, CustomerGender, CustomerYearly_salary, CustomerStreet, CustomerCity, CustomerState, CustomerPostcode, ProductId, PaymentId) >VALUES (12345678910,’Anna’, ’English’, 017362930115, ‘female’, 30000, ‘Augsburger_Str._84‘, ‘Senscheid’, ‘Rheinland-Pfalz’, 53520, 0101, 50000)

Error Code: 1054. Unknown column '’Anna’' in 'field list'


Solution

  • SQL thinks that Anna (and other values in front) are Columns as per the error message, replace with quotation marks:

    INSERT INTO CUSTOMER (Customerid, CustomerFname, CustomerLname, CustomerPhone, CustomerGender, CustomerYearly_salary, CustomerStreet, CustomerCity, CustomerState, CustomerPostcode, ProductId, PaymentId);
    
    VALUES (12345678910, 'Anna', 'English', 017362930115, 'female', 30000, 'Augsburger_Str._84', 'Senscheid', 'Rheinland-Pfalz', 53520, 0101, 50000);