I am trying to learn how to relate data in one table to another table.
Lets say I have a table called ‘car ids’ that contains nothing but ids for the cars stored in a separate table. This ‘separate’ table is called ‘cars’ and contains the car id AND make and model.
I am trying to come up with a mysql statement that selects the row from the car table by relating the id from the car id table to the car table.
Something like:
mysql_select(“SELECT * FROM cars WHERE id=[“SELECT id FROM car_id”]”);
I appreciate any advice.
I don’t know why you would have a table of just car id’s and then a table with the information about those cars, but here is the sort of query you would need
The key is using JOINs