27.08.2018, 05:02
Код:
mysql_format(handle, _query, sizeof(_query), "SELECT `AdminLevel`, `VIPLevel`, `RP`, `Hour`, `Skin`, `Coins`, `Gender`, `AliveTime` FROM `accounts` WHERE `Username` = '%e'", params); results = mysql_query(handle, _query); cache_get_value_name_int(0, "AdminLevel", adminLevel); cache_get_value_name_int(0, "VIPLevel", vipLevel); cache_get_value_name_bool(0, "RP", regularPlayer); cache_get_value_name_int(0, "Hour", score); cache_get_value_name_int(0, "Skin", skin); cache_get_value_name_int(0, "Coins", zCoins); cache_get_value_name_int(0, "Gender", gender); cache_get_value_name_int(0, "AliveTime", aliveTime); cache_delete(results); format(_query, sizeof(_query), "00,12--------[%s's stats]--------", params); IRC_GroupSay(gGroupID, channel, _query); format(_query, sizeof(_query), "Admin Level: \x1D%d\x1D", adminLevel); IRC_GroupSay(gGroupID, channel, _query); format(_query, sizeof(_query), "Premium Level: \x1D%d\x1D", vipLevel); IRC_GroupSay(gGroupID, channel, _query); format(_query, sizeof(_query), "Regular player: \x1D%s\x1D", regularPlayer ? "Yes" : "No"); IRC_GroupSay(gGroupID, channel, _query); format(_query, sizeof(_query), "Score: \x1D%d\x1D", score); IRC_GroupSay(gGroupID, channel, _query); format(_query, sizeof(_query), "zCoins: \x1D%d\x1D", zCoins); IRC_GroupSay(gGroupID, channel, _query); format(_query, sizeof(_query), "Gender: \x1D%s\x1D", gender == 1 ? ("Male") : gender == 2 ? ("Female") : ("Not specified")); IRC_GroupSay(gGroupID, channel, _query); format(_query, sizeof(_query), "Alive time: \x1D%d\x1D minute(s)", aliveTime / 60); IRC_GroupSay(gGroupID, channel, _query); IRC_GroupSay(gGroupID, channel, "00,12------------------------------");
Like; on table "accounts" u can see the "AdminLevel,VIPLevel,RP" but on another table called "Stats" where u can see "Hour,SKin,Coins,Gender,Alivetime"...
How can I select from 2 different tables? Thanks.