MySQL big problem
#2

Okay this for admins is fixed. But money command is not working.. It gives me money but it won't update it in db
PHP код:
CMD:setmoney(playeridparams[])
{
    if(
PlayerInfo[playerid][Admin] < 4)
    {
        
ERROR(playerid"You are not allowed to use this command");
        return 
1;
    }
    new 
targetammount;
    if(
sscanf(params"ui"targetammount))
    {
        
USAGE(playerid"/setmoney [ID/Name] [Ammount]");
        return 
1;
    }
    if(!
IsPlayerConnected(target))
    {
        
ERROR(playerid"That player is not connected");
        return 
1;
    }
    
ResetPlayerMoney(target);
    
GivePlayerMoney(targetammount);
    
PlayerInfo[target][Money] = ammount;
    new 
string[128], string2[128], query[128];
    
format(stringsizeof(string), ""YELLOW"[INFO] "WHITE"Admin "SERVERBLUE"%s "WHITE"setted your money to "SERVERBLUE"%d"GetName(playerid), ammount);
    
SCM(target, -1string);
    
format(string2sizeof(string2), "[INFO] Admin %s setted %s %d$"GetName(playerid), GetName(target), ammount);
    
AdminMessage(-1string2);
    
WriteLog(MONEYstring2);
    
mysql_format(g_SQLquerysizeof(query), "UPDATE `players` SET `Money` = %d WHERE `ID` = %d LIMIT 1"ammountPlayerInfo[target][ID]);
    
mysql_tquery(g_SQLquery);
    return 
1;

EDIT
I found this in log
Код:
08:34:48] [ERROR] error #1064 while executing query "UPDATE `players` SET `OrgJoined` = 3 `OrgLeader` = 3 `OrgRank` = 6 WHERE `ID` = 2 LIMIT 1": You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '`OrgLeader` = 3 `OrgRank` = 6 WHERE `ID` = 2 LIMIT 1' at line 1 (C:\Users\Micko\Desktop\MySQL\gamemodes\Untitled.pwn:2003)
[08:35:18] [WARNING] mysql_connect: no password specified (C:\Users\Micko\Desktop\MySQL\gamemodes\Untitled.pwn:160)
[08:35:50] [ERROR] cache_get_value_name: field 'password' not found (C:\Users\Micko\Desktop\MySQL\gamemodes\Untitled.pwn:591)
[08:35:50] [ERROR] cache_get_value_name: field 'salt' not found (C:\Users\Micko\Desktop\MySQL\gamemodes\Untitled.pwn:592)
[08:36:01] [ERROR] error #1064 while executing query "UPDATE `players` SET `OrgJoined` = 3 `OrgLeader` = 3 `OrgRank` = 6 WHERE `ID` = 2 LIMIT 1": You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '`OrgLeader` = 3 `OrgRank` = 6 WHERE `ID` = 2 LIMIT 1' at line 1 (C:\Users\Micko\Desktop\MySQL\gamemodes\Untitled.pwn:2003)
[08:36:17] [WARNING] mysql_connect: no password specified (C:\Users\Micko\Desktop\MySQL\gamemodes\Untitled.pwn:160)
[08:36:51] [ERROR] cache_get_value_name: field 'password' not found (C:\Users\Micko\Desktop\MySQL\gamemodes\Untitled.pwn:591)
[08:36:51] [ERROR] cache_get_value_name: field 'salt' not found (C:\Users\Micko\Desktop\MySQL\gamemodes\Untitled.pwn:592)
There is tons of these.. Any ideas?
Reply


Messages In This Thread
MySQL big problem - by Micko123 - 11.11.2016, 05:51
Re: MySQL big problem - by Micko123 - 11.11.2016, 06:46
Re: MySQL big problem - by Banditul18 - 11.11.2016, 07:28
Re: MySQL big problem - by Micko123 - 11.11.2016, 08:01
Re: MySQL big problem - by Micko123 - 11.11.2016, 08:14

Forum Jump:


Users browsing this thread: 2 Guest(s)