Unknown Column Error
Title: Unknown column ‘product_id’ in ‘field list’
Description: The SQL query references a column product_id that does not exist in the specified table.
Table Does Not Exist Error (payment_status)
Title: Table ‘ecommerce_db.payment_status’ doesn’t exist
Description: The SQL query references a table payment_status that does not exist in the database.
Table Does Not Exist Error (transactions)
Title: Table ‘ecommerce_db.transactions’ doesn’t exist
Description: The SQL query references a table transactions that does not exist in the database.
Table Does Not Exist Error (wallets)
Title: Table ‘ecommerce_db.wallets’ doesn’t exist
Description: The SQL query references a table wallets that does not exist in the database.
Unknown Column Error (orders)
Title: Unknown column ‘product_id’ in ‘field list’
Description: The SQL query for the orders table references a column product_id that does not exist in the table schema.
————————————–Error ———————————————-
Error: Prepare failed: Unknown column ‘product_id’ in ‘field list’0 resultsError: INSERT INTO payment_status (order_id, status) VALUES (”, ”)
Table ‘ecommerce_db.payment_status’ doesn’t existError: INSERT INTO transactions (order_id, transaction_id, amount) VALUES (”, ”, ”)
Table ‘ecommerce_db.transactions’ doesn’t existError: INSERT INTO wallets (user_id, balance) VALUES (‘1’, ”)
Table ‘ecommerce_db.wallets’ doesn’t existError: INSERT INTO orders (user_id, product_id, quantity) VALUES (‘1’, ‘123’, ‘1234’)
Unknown column ‘product_id’ in ‘field list’
Place Order
0 results
I attempted to execute SQL insert queries into various database tables (orders, payment_status, transactions, wallets) using PHP code. For orders, I used a prepared statement to insert values for user_id, product_id, and quantity. I expected the queries to execute successfully and data to be inserted into the database tables.
What I expected:
The INSERT INTO orders query should add a new record to the orders table.
The INSERT INTO payment_status query should add a new record to the payment_status table.
The INSERT INTO transactions query should add a new record to the transactions table.
The INSERT INTO wallets query should add a new record to the wallets table.
What actually resulted:
I received an error stating Unknown column ‘product_id’ in ‘field list’, indicating that the product_id column does not exist in the orders table.
I encountered errors indicating that the payment_status, transactions, and wallets tables do not exist in the database.
gamika sanjana is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.