MySQL Error
#4

Quote:
Originally Posted by Kindred
Посмотреть сообщение
pawn Код:
format(queryString, sizeof(queryString), "UPDATE utenti SET rank = '%d', soldi = '%d', id = '%d', level = '%d', experience = '%d', maxexp = '%d', tutorial = '%d'",Giocatore[playerid][rank],Giocatore[playerid][soldi],Giocatore[playerid][id],Giocatore[playerid][livello],Giocatore[playerid][exp],Giocatore[playerid][maxexp],Giocatore[playerid][tutorial]);
    format(queryString, sizeof(queryString),"%s, CX = '%f', CY = '%f', CZ = '%f WHERE username = '%s'",queryString,Giocatore[playerid][APOS][0],Giocatore[playerid][APOS][1],Giocatore[playerid][APOS][2],NomeX(playerid));
You are formatting it twice, therefore after you format it the first time, the string will only be the second format.

If you format directly after another format without doing anything to the first format, it will be overwrited.
pawn Код:
new queryString2[256];  //Change to string length
format(queryString, sizeof(queryString), "UPDATE utenti SET rank = '%d', soldi = '%d', id = '%d', level = '%d', experience = '%d', maxexp = '%d', tutorial = '%d'",Giocatore[playerid][rank],Giocatore[playerid][soldi],Giocatore[playerid][id],Giocatore[playerid][livello],Giocatore[playerid][exp],Giocatore[playerid][maxexp],Giocatore[playerid][tutorial]);
format(queryString2, sizeof(queryString),"%s, CX = '%f', CY = '%f', CZ = '%f WHERE username = '%s'",queryString,Giocatore[playerid][APOS][0],Giocatore[playerid][APOS][1],Giocatore[playerid][APOS][2],NomeX(playerid));
strcat(queryString, queryString2); //Add queryString2 to queryString.
Try this
It can be done on way he did it. Now reason why it probably doesn't work is, and I said this really one million times, ALL column names and tables names MUST be inside `` and all values between ' '. Like that you will remove possibilty that SQL Syntax error occurs.
Reply


Messages In This Thread
MySQL Error - by ProjectGANTON - 12.08.2012, 19:25
Re: MySQL Error - by Kindred - 12.08.2012, 19:37
Re: MySQL Error - by ProjectGANTON - 12.08.2012, 19:47
Re: MySQL Error - by [MG]Dimi - 12.08.2012, 21:32

Forum Jump:


Users browsing this thread: 1 Guest(s)