Hi
I am new to mySQL and PHP but have a simplified DB schema like thus:
Customer Table: cust_id, cust_name
Order Table: order_id, cust_id
I have a customer in the customer table -> cust_id=1
And I have an order in the Order table with cust_id = 1
I am just trying to join these two tables together as simply as I can but keep getting the following error:
>>>
You have an error in your SQL syntax near 'order WHERE customer.cust_id = order.cust_id AND customer.cust_id = '1'' at line 1
<<<
My full query is:
>>>
SELECT cust_id, cust_name, rainbow_order_id FROM customer, order
WHERE customer.cust_id = order.cust_id
AND customer.cust_id = '1'
<<<
I can't see why this doesn't work!
As I have said previously - I am new to mySQL and I can't see a way to configure the DB to create the relationships to each table as you would normally do in MS-Sql Server and MS Access. Am I missing something?
Regards
Andy
I am new to mySQL and PHP but have a simplified DB schema like thus:
Customer Table: cust_id, cust_name
Order Table: order_id, cust_id
I have a customer in the customer table -> cust_id=1
And I have an order in the Order table with cust_id = 1
I am just trying to join these two tables together as simply as I can but keep getting the following error:
>>>
You have an error in your SQL syntax near 'order WHERE customer.cust_id = order.cust_id AND customer.cust_id = '1'' at line 1
<<<
My full query is:
>>>
SELECT cust_id, cust_name, rainbow_order_id FROM customer, order
WHERE customer.cust_id = order.cust_id
AND customer.cust_id = '1'
<<<
I can't see why this doesn't work!
As I have said previously - I am new to mySQL and I can't see a way to configure the DB to create the relationships to each table as you would normally do in MS-Sql Server and MS Access. Am I missing something?
Regards
Andy