I'm attempting to create a query in phpMyadmin that would allow me to insert a new row of data in my product table, and I am having difficulty doing so because of the foreign key constraint.
I have researched this issue for quite some time and I thought I had the correct syntax down, but I am still getting a generic message saying that there is an issue with my syntax:
1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'British Bus Model’, ( SELECT productLine FROM productlines WHERE product' at line 3
Below is the code that I am using:
INSERT INTO products (productCode, productName, productLine, productScale, productVendor, productDescription, quantityInStock, buyPrice, MSRP)
VALUES ( ‘S72_3213’ , ‘Double-Decker British Bus Model’,
( SELECT productLine
FROM productlines
WHERE productLine = ‘Double-Decker Buses’) , 1:33 , ‘Classic Bus Models’ , ‘testing’ , 150, 50.00 , 90.00 );
I'm basically trying to enter new data for the product except for the productLine which should be pulled from the productlines table. Any advice on what is wrong with my syntax would be much appreciated. Thank you!!