04.12.2012, 16:43
Use joins.
This will return all players that have a vehicle. If you want all players, even those who don't have a vehicle use LEFT JOIN.
Documentation: http://www.w3schools.com/sql/sql_join.asp
PHP код:
SELECT *
FROM usertable JOIN vehicletable
ON usertable.vID = vehicletable.vID
PHP код:
SELECT *
FROM usertable LEFT JOIN vehicletable
ON usertable.vID = vehicletable.vID