MYSQL Query
Posted: Sat Aug 12, 2006 7:21 am
Hi, I am new with mysql, having problem with "transfering" ids in first table with real names from another table connected by id. In this code i menaged to do it with t1.host_id into t2.username, but i dont have idea how to do it with t1.b_seat and t1.b_seat. They are integers in table "tabla".
Could it be done like :
... but then i am repeating t2.username. Please help.
Code: Select all
$query = "SELECT t1.room_id as Room, t2.username as Host, t1.w_seat as White, t1.b_seat as Black, t1.vrijeme as Time, t1.povecanje as Increment FROM tabla as t1, player as t2 WHERE t1.host_id = t2.player_id";Code: Select all
$query = "SELECT t1.room_id as Room, t2.username as Host, t2.username as White, t2.b_seat as Black, t1.vrijeme as Time, t1.povecanje as Increment FROM tabla as t1, player as t2 WHERE t1.host_id = t2.player_id";