I need to create a join query for the following:
Table supplier:
- id
- name
Table supplier_vehicles
- id
- supplier_id
- vehicle_id
A supplier can have multiple vehicles.
On my front-end form I have a checkbox list - a user can select multiple vehicles. The back end script needs to do a search and bring back all suppliers that contain any of the specified vehicle id's.
The checkbox list name is vehicle_type[] and will end up in the $_POST array as (for example):
Array
(
[0] => 1
[1] => 4
[2] => 6
)
At the moment I could do with with some SQL examples so that I can test the query using different values.