SYNTAX ERROR SQL
#1

PHP код:
================ ERROR ==================
[
06:38:55] [ERRORCMySQLQuery::Execute[Account_Registered] - (error #1064) 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 '' at line 1
[06:44:36] [ERRORmysql_format destination size is too small
[06:44:36] [ERRORCMySQLQuery::Execute[account_Registered] - (error #1064) 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 ''0' at line 1
[06:45:02] [ERRORmysql_format destination size is too small
[06:45:02] [ERRORCMySQLQuery::Execute[account_Saved] - (error #1064) 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 '' at line 1
======================================= 
PHP код:
================== CODE =================
================== 
REGISTER ==============
forward Registeraccount(playerid);
public 
Registeraccount(playerid)
{
    
PlayerInfo[playerid][pLogged] = true;
    
PlayerInfo[playerid][pLevel] = 0;
    
PlayerInfo[playerid][pAdmin] = 0;
    
PlayerInfo[playerid][pMoney] = 5000;
    
PlayerInfo[playerid][pWrongPass] = 0;
    
ResetPlayerMoney(playerid);
    new 
Query[300];
    
mysql_format(ConnectionQuerysizeof(Query), "INSERT INTO `account`(`Name`, `Password`, `Email`, `Admin`, `Sex`, `Age`, `Level`, `Money`, `Skin`, `pCar`, `pSaxlid`, `pInterieri`, `pBankfuli`, `pBorbali`,`pSpoileri`,`pBamperi2`,`pPaintjobi`,`pHydrawlic`,`pSatiety`, `pWyurvili`) VALUES ('%e','%e','%e','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d')",
    
Name(playerid),
    
PlayerInfo[playerid][pPassword],
    
PlayerInfo[playerid][pEmail],
    
PlayerInfo[playerid][pAdmin],
    
PlayerInfo[playerid][pSex],
    
PlayerInfo[playerid][pAge],
    
PlayerInfo[playerid][pLevel],
    
PlayerInfo[playerid][pMoney],
    
PlayerInfo[playerid][pCar],
    
PlayerInfo[playerid][pSaxlid],
    
PlayerInfo[playerid][pInterieri],
    
PlayerInfo[playerid][pBankfuli],
    
PlayerInfo[playerid][pBorbali],
    
PlayerInfo[playerid][pSpoileri],
    
PlayerInfo[playerid][pBamperi2],
    
PlayerInfo[playerid][pPaintjobi],
    
PlayerInfo[playerid][pHydrawlic],
    
PlayerInfo[playerid][pSatiety],
    
PlayerInfo[playerid][pWyurvili]);
    
mysql_tquery(ConnectionQuery"account_Registered""d"playerid);
    
SendClientMessage(playerid, -1"Aqaunti Warmatebit Sheiqmna.");
    
SetPlayerScore(playeridPlayerInfo[playerid][pLevel]);
    
GivePlayerMoney(playeridPlayerInfo[playerid][pMoney]);
    
SetSpawnInfo(playerid0PlayerInfo[playerid][pSkin], 1721.8422, -1880.179313.5649269.15000000);
    
SpawnPlayer(playerid);
    
HideTextDraw(playerid);
    return 
1;
}
=========================================================
================ 
SAVE ACCOUNT ===============================
forward Saveaccount(playerid);
public 
Saveaccount(playerid)
{
    if(
PlayerInfo[playerid][pLogged] == false) return 1;
    
PlayerInfo[playerid][pMoney] = GetPlayerMoney(playerid);
    
ResetPlayerMoney(playerid);
    new 
Query[300];
    
mysql_format(ConnectionQuerysizeof(Query), "UPDATE `account` SET `Name`='%e', `Password`='%e', `Email`='%e', `Admin`='%d', `Sex`='%d', `Age`='%d', `Level`='%d', `Money`='%d', `Skin`='%d',`pCar`='%d', `pSaxlid`='%d', `pInterieri`='%d', `pBankfuli`='%d', `pBorbali`='%d',`pSpoileri`='%d',`pBamperi2`='%d',`pPaintjobi`='%d',`pHydrawlic`='%d', `pSatiety`='%d', `pWyurvili`='%d', WHERE `ID`='%d'",
    
Name(playerid),
    
PlayerInfo[playerid][pPassword],
    
PlayerInfo[playerid][pEmail],
    
PlayerInfo[playerid][pAdmin],
    
PlayerInfo[playerid][pSex],
    
PlayerInfo[playerid][pAge],
    
PlayerInfo[playerid][pLevel],
    
PlayerInfo[playerid][pMoney],
    
PlayerInfo[playerid][pSkin],
    
PlayerInfo[playerid][pCar],
    
PlayerInfo[playerid][pSaxlid],
    
PlayerInfo[playerid][pInterieri],
    
PlayerInfo[playerid][pBankfuli],
    
PlayerInfo[playerid][pBorbali],
    
PlayerInfo[playerid][pSpoileri],
    
PlayerInfo[playerid][pBamperi2],
    
PlayerInfo[playerid][pPaintjobi],
    
PlayerInfo[playerid][pHydrawlic],
    
PlayerInfo[playerid][pSatiety],
    
PlayerInfo[playerid][pWyurvili],
    
PlayerInfo[playerid][pID]);
    
mysql_tquery(ConnectionQuery"account_Saved""d"playerid);
    
PlayerInfo[playerid][pLogged] = false;
    return 
1;
}
===================================================== 
HELP ME PLEASE. I REALLY NEED THIS SCRIPT FOR MY GAMEMODE!
Reply
#2

You need to increase the size of your query string, as it says here:

Код:
mysql_format - destination size is too small
Reply
#3

PHP код:
[07:31:44] [ERRORCMySQLQuery::Execute[account_Saved] - (error #1064) 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 'WHERE `ID`='5'' at line 1 
And About This? :/
Reply
#4

Quote:

`pWyurvili`='%d', WHERE `

Remove that comma in red.
Reply
#5

Thaanks All Guys
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)