duanju9104 2016-06-12 06:59
浏览 33

MySQL - 如何将来自两个数据库的表组合成一个带有$ _GET的php查询字符串?

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!

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 关于#Java#的问题,如何解决?
    • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
    • ¥15 想问一下树莓派接上显示屏后出现如图所示画面,是什么问题导致的
    • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
    • ¥15 cmd cl 0x000007b
    • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
    • ¥500 火焰左右视图、视差(基于双目相机)
    • ¥100 set_link_state
    • ¥15 虚幻5 UE美术毛发渲染
    • ¥15 CVRP 图论 物流运输优化