I want to query multiple tables data from two databases and display the data in a unique id php query string. e.g ?player=123456789
.
Both databases have a table that is storing a unique ID that will be used to show a players data. The ID tables between the databases cannot match eachother in any way. I want to mention that I know how to do this with one database at the time.
For example I have steamID
for $db1
players and a playerID
for $db2
players.
There is no unique similarity between the IDs from each database.
I am using intval($_GET['player'])
to display data in the php query string.
$db1
works fine if queried alone, so does $db2
but how can I combine the both to show in my query string? My code down below.
$db1 = 'SELECT * FROM `wm_round_stats` WHERE `steam_id_64`= '.intval($_GET['player']);
$db2 = "SELECT map, COUNT(killerId) AS totalkills
FROM hlstats_Events_Frags
WHERE killerId='" intval($_GET['player']) "' GROUP BY map ORDER BY map";
WHERE killerId='" intval($_GET['player']) "'
WHERE steam_id_64='" intval($_GET['player'])
How to combine these two above and both databases?
steamID
is steam_id_64
and playerID
is killerId
in my code from my example above.
I am grateful for the help!