View Single Post
GetRektByNoob
Member
Join Date: Nov 2018
Old 08-20-2019 , 14:22   Re: Problem MySQL T_LoadData
Reply With Quote #4

afaik you are trying to find the field index but the result is not fetched try doing
Code:
 //If a row set was returned:
    if(results.FetchRow())
    {
	int valoareCol;
    	results.FieldNameToNum("valoare", valoareCol);
        valoare[client] = results.FetchInt(valoareCol);
    }
    else
    {
        //not found in db, insert data:
        char steamid[32]; GetClientAuthId(client, AuthId_Steam2, steamid, sizeof(steamid));
        char query[256]; Format(query, sizeof(query), "INSERT INTO jailbreak_test (steamid) VALUES ('%s') ON DUPLICATE KEY UPDATE steamid = '%s';", steamid, steamid);
        db.Query(T_Generic, query);
    }

Last edited by GetRektByNoob; 08-20-2019 at 14:22.
GetRektByNoob is offline