Juan Silva Juan Silva - 5 months ago 10
MySQL Question

Select from 3 tables php

at first sorry for my bad english, but i need to do a table with GET method to select data of 3 tables

where $_GET['steamid']:
achievements (id, name, description);
progress (id_player, achieve_id, progress);
global (id_player, steamid, nick);

to put in a table, example:
Achievement | Progress
name_achievement | 5


like at: http://achievements.my-run.de/index.php?server=jail

Answer

You need to use a join to join your tables into one query. I think this should work, just bind the GET value.

select a.name, p.progress from global as g
join progress as p
on g.id_player = p.id_player
join achievements as a
on p.achieve_id = a.id
where g.steamid = ?
Comments