How to 'link' the two ids?
#3

Use joins.

PHP код:
SELECT *
FROM usertable JOIN vehicletable
    ON usertable
.vID vehicletable.vID 
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.

PHP код:
SELECT *
FROM usertable LEFT JOIN vehicletable
    ON usertable
.vID vehicletable.vID 
Documentation: http://www.w3schools.com/sql/sql_join.asp
Reply


Messages In This Thread
How to 'link' the two ids? - by Elysian` - 03.12.2012, 18:06
Re: How to 'link' the two ids? - by Elysian` - 03.12.2012, 18:19
Re: How to 'link' the two ids? - by Sinner - 04.12.2012, 16:43
Re: How to 'link' the two ids? - by Elysian` - 04.12.2012, 17:06
Re: How to 'link' the two ids? - by Bakr - 04.12.2012, 17:20
Re: How to 'link' the two ids? - by Elysian` - 04.12.2012, 17:23
Re: How to 'link' the two ids? - by Elysian` - 04.12.2012, 17:33
Re: How to 'link' the two ids? - by Elysian` - 04.12.2012, 17:40
Re: How to 'link' the two ids? - by Bakr - 04.12.2012, 17:48
Re: How to 'link' the two ids? - by Elysian` - 04.12.2012, 18:34

Forum Jump:


Users browsing this thread: 1 Guest(s)