SA-MP Forums Archive
MYSQL fields doesnt found - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: MYSQL fields doesnt found (/showthread.php?tid=625757)



MYSQL fields doesnt found - Oshery - 06.01.2017

Can anyone please help me with my server? i'm using mysql connection but when any user connect to server i see mysql.log, [21:27:57] [WARNING] cache_get_row_count - no active cache
[21:27:57] [WARNING] cache_get_row_count - no active cache
[21:28:08] [WARNING] CMySQLResult::GetRowDataByName - field not found ("Score")
[21:28:08] [WARNING] CMySQLResult::GetRowDataByName - field not found ("Cash")
[21:28:08] [WARNING] CMySQLResult::GetRowDataByName - field not found ("Level")
[21:28:08] [WARNING] CMySQLResult::GetRowDataByName - field not found ("Coins")
[21:28:08] [WARNING] CMySQLResult::GetRowDataByName - field not found ("Kills")
[21:28:08] [WARNING] CMySQLResult::GetRowDataByName - field not found ("Deaths")
[21:28:08] [WARNING] CMySQLResult::GetRowDataByName - field not found ("Vip")
[21:28:08] [WARNING] CMySQLResult::GetRowDataByName - field not found ("Kicks")
[21:28:08] [WARNING] CMySQLResult::GetRowDataByName - field not found ("Bans")
[21:28:08] [WARNING] CMySQLResult::GetRowDataByName - field not found ("Jails")
[21:28:08] [WARNING] CMySQLResult::GetRowDataByName - field not found ("license")
[21:28:08] [WARNING] CMySQLResult::GetRowData - invalid row ('1') or field index ('0')

And the user isnt begin saved after deisconnecting, can anyone please help me solving it out?
skype? or any other social network?


Re: MYSQL fields doesnt found - BiosMarcel - 06.01.2017

We need code, otherwise we can't help. You shouldn't come here and expect external help (skype and such).


Re: MYSQL fields doesnt found - saffierr - 06.01.2017

Show us your OnPlayerDisconnect for the saving part.
For your errors, show us the appropriate related code.


Re: MYSQL fields doesnt found - Oshery - 06.01.2017

i have to create Accounts table but i dont know how to do it, ive just created colums or however it is names.
i dont know what i should show you, the mainly reason why i need external help..


Re: MYSQL fields doesnt found - saffierr - 06.01.2017

I just told you, what to show... "OnPlayerDisconnect" and the code of the errors.


Re: MYSQL fields doesnt found - Oshery - 07.01.2017

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..


Re: MYSQL fields doesnt found - Oshery - 12.01.2017

bump//


Re: MYSQL fields doesnt found - AmigaBlizzard - 13.01.2017

That code isn't related to your problem.

Your problem lies in OnPlayerConnect, where you LOAD the data, not saving in OnPlayerDisconnect.

Show us OnPlayerConnect, or whatever you use (callback or function after logging in) to load your data when a player connects to your server.