26.08.2014, 12:45
So I have a problem with my mysql data loading.
I want it to load the stuff from my database, but it loads some random values.
I checked, if there was a typo in the field idx, but there was not - those values, that it loaded were not even in my mysql database.
Here's the code
LoadAcc
I want it to load the stuff from my database, but it loads some random values.
I checked, if there was a typo in the field idx, but there was not - those values, that it loaded were not even in my mysql database.
Here's the code
Код:
format(query, sizeof(query), "SELECT * FROM `players` WHERE `name` = '%s'", playerName(playerid)); mysql_function_query(g_Handle, query, true, "LoadAcc", "d", playerid);
Код:
PlayerInfo[playerid][kSQLID] = cache_get_row_int(0, 0, g_Handle), PlayerInfo[playerid][kAdmin] = cache_get_row_int(0, 3, g_Handle), PlayerInfo[playerid][kBanned] = cache_get_row_int(0, 5, g_Handle), PlayerInfo[playerid][kLang] = cache_get_row_int(0, 6, g_Handle), PlayerInfo[playerid][kWarn] = cache_get_row_int(0, 7, g_Handle), PlayerInfo[playerid][kMoney] = cache_get_row_int(0, 9, g_Handle), PlayerInfo[playerid][kSkin] = cache_get_row_int(0, 10, g_Handle), PlayerInfo[playerid][kScore] = cache_get_row_int(0, 13, g_Handle); cache_get_row(0, 1, PlayerInfo[playerid][kName], g_Handle, 70); cache_get_row(0, 2, PlayerInfo[playerid][kPW], g_Handle, 130); cache_get_row(0, 14, PlayerInfo[playerid][kSalt], g_Handle, 31);