I have three tables: trips, salesmen, locations
In "trips" i have the clients name, the salesman's ID number and the location ID number.
I am querying the DB for a specific client name, and want to show the results, but with the actual names of the locations and salesmen not their ID numbers.
So here is my query that is NOT working:
SELECT trips.*, locations.*, salesmen.*
FROM trips, locations, salesmen
WHERE trips.locationid = locations.id && trips.salesmen_id = salesmen.id
This is returning a massive amount of data that repeats itself. And I happen to know, for the client I am querying their are 7 trips.
What do I do to get it to "convert" the ID numbers in trips to their full names stored in "locations" and "salesmen"?
Please help, and thank you!