Код:
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------------------------------");
I updated the database so they are not just in a single table.
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"...
You need relation between two tables in order to fetch data from both.Otherwise it will produce cartesian product between two tables as in SETS.
The above query performs an equi-join on two tables table1 and table2 and commonid is the field which has matching value in table1 and table2.