MySQL database! Data gets into wrong columns.
#9

try to get row by row name
example
pawn Код:
forward MysqlLoadPlayer(playerid);
public MysqlLoadPlayer(playerid)
{
    new rows, fields;

    cache_get_data(rows, fields);
    if(rows)
    {
        new temp[128];

       

        PlayerInfo[playerid][UID] = cache_get_field_content_int(0, "ID"); // remeber use your column name this is an example
        cache_get_field_content(0,"RegisterDate", PlayerInfo[playerid][RegisterDate]);
        format(PlayerInfo[playerid][RegisterDate], 30, "%s", temp);
        PlayerInfo[playerid][Level] = cache_get_field_content_int(0, "Level");
        PlayerInfo[playerid][Helper] = cache_get_field_content_int(0, "Helper");
        PlayerInfo[playerid][dRank] = cache_get_field_content_int(0, "dRank");
        cache_get_field_content(0,"Password", PlayerInfo[playerid][Password]);
        cache_get_field_content(0,"Nick", PlayerInfo[playerid][Nick]);
        format(PlayerInfo[playerid][Nick], 21, "%s", temp);
        format(PlayerInfo[playerid][Password], 128, "%s", temp);
        PlayerInfo[playerid][Kills] = cache_get_field_content_int(0, "Kills");
        PlayerInfo[playerid][Deaths] = cache_get_field_content_int(0, "Deaths");
        PlayerInfo[playerid][Score] = cache_get_field_content_int(0, "Score");
        PlayerInfo[playerid][Money] = cache_get_field_content_int(0, "Money");
        PlayerInfo[playerid][Headshots] = cache_get_field_content_int(0, "Headshots");

        GivePlayerCash(playerid, PlayerInfo[playerid][Money]);
        SetPlayerScore(playerid, PlayerInfo[playerid][Score]);

        format(query, sizeof(query), "SELECT * FROM `Prestiges` WHERE `Nick` = '%s'", escpname(playerid));
        mysql_function_query(connectionhandle, query, true, "MysqlLoadPrestige", "i", playerid);

        PlayerInfo[playerid][LoggedIn] = true;
            OnPlayerRequestClass(playerid, 0);
           return 1;
           }
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)