MYSQL fields doesnt found
#6

Here the OnPlayerDisconnect code,

Код:
public OnPlayerDisconnect(playerid, reason)
{

PlayersOnline--;
//StealingA69Prot[playerid] = 0;  //prototype
//++++++++++++++++++++SQL+++++++++++++++++
if(Logged[playerid] == 1 && buggy[playerid] == 0)
{
        //If the player disconnects before registering,
        //we want to make sure it doesn't try update
        //so we check if the player is logged in.
        PlayerInfo[playerid][Level] = TempAdmin[playerid];
        new score = GetPlayerScore(playerid); //Gets players score
        new money = GetPlayerMoney(playerid); //Gets players money
        new query[200], pname[24]; //Creates the variables
        GetPlayerName(playerid, pname, 24); //Gets the players name.
       	new h, m, s; TotalGameTime(playerid, h, m, s);
        format(query, sizeof(query), "UPDATE Accounts SET Score=%d, Cash=%d WHERE Name='%s'", score, money, pname);
        mysql_query(connection, query);
        format(query, sizeof(query), "UPDATE Accounts SET Level=%d, Coins=%d, Kills=%d, Deaths=%d, Vip=%d, Kicks=%d, Bans=%d, Jails=%d, license=%d WHERE Name='%s'", PlayerInfo[playerid][Level], PlayerInfo[playerid][Helper], PlayerInfo[playerid][Kills], PlayerInfo[playerid][Deaths], PlayerInfo[playerid][dRank], h, m, s, License[playerid], pname);
        mysql_query(connection, query);
        //No need to store a result for a update string
}
And here is the code of the create table Accounts which is giving me the mysql errors above^,
Код:
 mysql_query(connection, "CREATE TABLE IF NOT EXISTS Accounts(Name VARCHAR(24), password VARCHAR(40), IP VARCHAR(16), Cash INT(20), Score INT(30), Level INT(10), Kills INT(20), Deaths INT(20), viplevel INT(10))");
I don't know how to set it so please tell me if you know about it..
Reply


Messages In This Thread
MYSQL fields doesnt found - by Oshery - 06.01.2017, 01:25
Re: MYSQL fields doesnt found - by BiosMarcel - 06.01.2017, 01:29
Re: MYSQL fields doesnt found - by saffierr - 06.01.2017, 01:35
Re: MYSQL fields doesnt found - by Oshery - 06.01.2017, 01:50
Re: MYSQL fields doesnt found - by saffierr - 06.01.2017, 01:54
Re: MYSQL fields doesnt found - by Oshery - 07.01.2017, 00:18
Re: MYSQL fields doesnt found - by Oshery - 12.01.2017, 21:56
Re: MYSQL fields doesnt found - by AmigaBlizzard - 13.01.2017, 09:21

Forum Jump:


Users browsing this thread: 2 Guest(s)