Please help mysql_query running error.
#1

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
Reply
#2

Read the error. It says you wrote the sql statement wrong
Reply
#3

Where? everything is okey..
Reply
#4

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

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

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

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)"
Reply
#8

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]);
Reply
#9

Do you seriously have all that in OnPlayerUpdate -.-
Reply
#10

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


Forum Jump:


Users browsing this thread: 1 Guest(s)