SA-MP Forums Archive
Please help mysql_query running error. - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Please help mysql_query running error. (/showthread.php?tid=160252)



Please help mysql_query running error. - Script - 16.07.2010

When a player login in the server.. i get this error to my logs..


Код:
[09:57:43] Error in mysql_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 'Int=0,Local=255,Team=3,Model=0,PhNumber=0,HouseKey=2555,BizzKey=255,CarKey=0,Car' at line 1
It's spamming error message.

Im using Lux0r mySQL.

thanks for help


Re: Please help mysql_query running error. - dice7 - 16.07.2010

Read the error. It says you wrote the sql statement wrong


Re: Please help mysql_query running error. - Script - 16.07.2010

Where? everything is okey..


Re: Please help mysql_query running error. - dice7 - 16.07.2010

It obviously isn't. And you could show the code, maybe someone'll find an error


Re: Please help mysql_query running error. - Script - 16.07.2010

The error doensnt give me a line.. i dont know in what code the error is


Re: Please help mysql_query running error. - [HiC]TheKiller - 16.07.2010

CNRTL F
Enter Int=0,Local=255,Team=3,Model=0,PhNumber=0,HouseKey =2555,BizzKey=255,CarKey=0,Car
PRESS ENTER.

Post the line with the issue . Also, make sure your query string is large enough.


Re: Please help mysql_query running error. - dice7 - 16.07.2010

He won't find anything with that, since the strings are probably getting formated. Check the code which gets executed when a player logs in ("/login", OnPlayerLogin or something along those lines) and search for anything which would look like this "SELECT something FROM somewhere WHERE name='%s'",name" or "UPDATE something SET password='%s', admin=%d, cash=%d, score=%d WHERE name=%d", pass, admin, cash, score, name)"


Re: Please help mysql_query running error. - Script - 16.07.2010

I checked now.. and the problem is at OnPlayerUpdate

here is the code.


Код:
			MySQLCheckConnection();
			new query[MAX_STRING];
			format(query, MAX_STRING, "UPDATE players SET ");
			MySQLUpdatePlayerStr(query, PlayerInfo[playerid][pSQLID], "Password", PlayerInfo[playerid][pKey]);
			PlayerInfo[playerid][pCash] = GetPlayerCash(playerid);
			MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Level", PlayerInfo[playerid][pLevel]);
			MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Admin", PlayerInfo[playerid][pAdmin]);
			MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "DonateRank", PlayerInfo[playerid][pDonateRank]);
			MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "UpgradePoints", PlayerInfo[playerid][gPupgrade]);
			MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Registered", PlayerInfo[playerid][pReg]);
			MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Sex", PlayerInfo[playerid][pSex]);
			MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Age", PlayerInfo[playerid][pAge]);
			MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "CK", PlayerInfo[playerid][pCK]);
			MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Cash", PlayerInfo[playerid][pCash]);
			MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Bank", PlayerInfo[playerid][pAccount]);
			MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Crimes", PlayerInfo[playerid][pCrimes]);
			MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Mute", PlayerInfo[playerid][pMuted]);
			MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Warn", PlayerInfo[playerid][pWarns]);
			MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Skin", PlayerInfo[playerid][pChar]);
			MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Int", PlayerInfo[playerid][pInt]);
			MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "VirWorld", PlayerInfo[playerid][pVirWorld]);
			MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Local", PlayerInfo[playerid][pLocal]);
			MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Team", PlayerInfo[playerid][pTeam]);
			MySQLUpdatePlayerInt(query, PlayerInfo[playerid][pSQLID], "Model", PlayerInfo[playerid][pModel]);
MySQLUpdateFinish(query, PlayerInfo[playerid][pSQLID]);



Re: Please help mysql_query running error. - FUNExtreme - 16.07.2010

Do you seriously have all that in OnPlayerUpdate -.-


Re: Please help mysql_query running error. - Script - 16.07.2010

I have more, but that is the error lines.. so.. i posted it