MYSQL Problem
#1

If I use /setlevel my Level change in Game but not in my database is there a mistake in this line ?

PHP код:
format(query,sizeof(query),"UPDATE user SET Score='%i',money='%i',AdminLevel='%i', WHERE ID='%i'",sInfo[playerid][Score],GetPlayerMoney(playerid),sInfo[playerid][AdminLevel],sInfo[playerid][ID]); 
MYSQL_LOG.TXT
PHP код:
[16:13:40] [ERRORCMySQLQuery::Execute[()] - (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='1'' at line 1 
Reply
#2

pawn Код:
format(query,sizeof(query),"UPDATE `user` SET `Score`='%d',`money`='%d',`AdminLevel`='%i' WHERE ID='%d'",sInfo[playerid][Score],GetPlayerMoney(playerid),sInfo[playerid][AdminLevel],sInfo[playerid][ID]);
mysql_query(query);
Reply
#3

Still the same Error...
Reply
#4

I edited my post
Reply
#5

Thank you but can you say me what you edit and where the Problem was I gave you rep
Reply
#6

You never put a comma before "WHERE", thats where the problem was occuring
Reply
#7

not this only MikeEd, you should also add two ` ` between the user word and all the other enums like score kills etc
Reply
#8

Quote:
Originally Posted by Eth
Посмотреть сообщение
not this only MikeEd, you should also add two ` ` between the user word and all the other enums like score kills etc
Nope, you are not supposed to use ` ` "between the user word an all the other enum".

They are unnecessary. I don't use ` `, I just use ' ' for strings, that's all.
Everything that isn't a string doesn't require ` `.
Reply
#9

You should consider learning MySQL before continuing.

http://www.w3schools.com/sql/ basic stuff here.

You could compromise your entire database if you use mysql incorrectly.
Reply
#10

Red = error
Green = don't need

Quote:

format(query,sizeof(query),"UPDATE user SET Score='%i',money='%i',AdminLevel='%i', WHERE ID='%i'",sInfo[playerid][Score],GetPlayerMoney(playerid),sInfo[playerid][AdminLevel],sInfo[playerid][ID]);

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)