little mysql UPDATE query help
#1

hi,

i just cant figure out why this query is not working:

pawn Код:
Current_Map_Name="Jefferson";
Current_Map_Mode="TDM";

new querymap[64];
format(querymap, sizeof(querymap), "UPDATE list SET map='%s [%s]', player='0'",Current_Map_Name,Current_Map_Mode);
mysql_query(querymap);
Before i added the [%s] part it was working just fine, now it tells me wrong mysql syntax.


thanks.
Reply
#2

pawn Код:
format(querymap, sizeof(querymap), "UPDATE list SET map='%s', '%s', player='0'",Current_Map_Name,Current_Map_Mode);
Reply
#3

not working.
Also i would like to have the brackets in the query...
Reply
#4

EDIT - Nevermind
Reply
#5

Could you paste here your syntax error message?
Reply
#6

just this: [MySQL] 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 '' at line 1.
Reply
#7

pawn Код:
Current_Map_Name="Jefferson";
Current_Map_Mode="TDM";
new mapstring[100];
format(mapstring, sizeof(mapstring), "%s [%s]",Current_Map_Name,Current_Map_Mode);
new querymap[64];
format(querymap, sizeof(querymap), "UPDATE `list` SET map = '%s', player = '0'", mapstring);
mysql_query(querymap);
Now?
Reply
#8

pawn Код:
format(querymap, sizeof(querymap), "UPDATE `list` SET `map`='%s', player='0'",Current_Map_Name);
Try now.

EDIT: TOO LATE.
Reply
#9

put print(querymap) in, and please tell me what is written in the console so I can see what's wrong.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)