SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 08/08/2013, 08:32 PM   #1
George_Fratelli
Little Clucker
 
Join Date: Jul 2011
Posts: 11
Reputation: 0
Default MySQL error 0 [Help]

Yeah, I get this error in the server.exe whenever a player disconnects my server and the data does not save.

pawn Code:
Error (0): Failed to exeute query. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'id` = '1' LIMIT 1' at line 1.

The code:

pawn Code:
SavePlayer(playerid)
{
    if(pInfo[playerid][Logged] == 1)
    // checks if the player is logged
    {
        new Query[500];
        format(Query, 500, "UPDATE `playerdata` SET `admin` = '%d', `score` = '%d', `money` = '%d', `kills` = '%d', `deaths` = '%d', `sec` = '%d', `min` = '%d', `hour = '%d' WHERE `id` = '%d'",
        pInfo[playerid][pAdmin],
        pInfo[playerid][pKills],
        GetPlayerMoney(playerid),
        pInfo[playerid][pKills],
        pInfo[playerid][pDeaths],
        pInfo[playerid][pSec],
        pInfo[playerid][pMin],
        pInfo[playerid][pHour],
        pInfo[playerid][ID]);
        mysql_query(Query);
//this basically gets the variables and stores it to the players special identifier called "ID".
    }
}


EDIT: Nevermind, I've fixed it already.
George_Fratelli is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Mysql Error using the Mysql 2.1.1 Plugin yvoms Scripting Help 2 07/06/2013 11:48 PM
MySQL error 1064 - error in SQL syntax Bu$ter Scripting Help 2 23/05/2013 11:22 AM
Mysql Error: 1064 You have an error in your SQL syntax Robert_Crawford Scripting Help 2 26/10/2012 03:39 AM
MySQL Error (In the MySQL log) Unknown123 Help Archive 10 28/02/2011 11:24 PM


All times are GMT. The time now is 01:18 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.