SA-MP Forums Archive
[Ajuda] Erro mysql - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Erro mysql (/showthread.php?tid=615411)



Erro mysql - social - 22.08.2016

toda hora ta dando esse erro no log mysql alguem me ajuda pfv

PHP код:
[23:39:12] [ERRORmysql_format no value for specifier "%d" available
[23:39:12] [ERRORCMySQLQuery::Execute[DadosSalvos] - (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 '' at line 1
[23:39:12] [ERRORmysql_format no value for specifier "%d" available
[23:39:12] [ERRORCMySQLQuery::Execute[DadosSalvos] - (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 '' at line 1
[23:39:26] [ERRORmysql_format no value for specifier "%d" available
[23:39:26] [ERRORCMySQLQuery::Execute[DadosSalvos] - (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 '' at line 1
[23:39:26] [ERRORmysql_format no value for specifier "%d" available
[23:39:26] [ERRORCMySQLQuery::Execute[DadosSalvos] - (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 '' at line 1
[23:40:14] [ERRORmysql_format no value for specifier "%d" available
[23:40:14] [ERRORCMySQLQuery::Execute[DadosSalvos] - (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 '' at line 1 
PHP код:
forward DadosSalvos(playerid);
public 
DadosSalvos(playerid)
{
    
printf("-> Conta salva ID: %d"APlayerData[playerid][ID]);
    return 
1;

PHP код:
  new Query[507]; // variavel com 507 celulas para salvamento
       
mysql_format(mysqlQuerysizeof(Query), "UPDATE `Contas` SET `Nome`='%s', `Scores`=%d, `Admin`=%d, `Skin`=%d, `Matou`=%d, `Mortes`=%d, `FACCOES`=%d, `Vip`=%d, `Dono`=%d, `DJ`=%d, `Fogueteiro`=%d, `Lider`=%d, `PCRJ`=%d, `PMRJ`=%d, `BOPE`=%d, `Reporter`=%d, `pHelper`=%d, `Logou`=%d, `Preso`=%d, `Fogos`=%d, `CMD`=%d, `LLL`=%d, `TCP`=%d, `MLC`=%d, `MTX`=%d, `Iniciante`=%d, `Dinheiro`=%d, `FRENTE`=%d, `Vapor`=%d, `Gerente`=%d WHERE `ID`=%d",
    
Nome(playerid),
    
APlayerData[playerid][Scores],
    
APlayerData[playerid][Admin],
    
APlayerData[playerid][Skin],
    
APlayerData[playerid][Matou],
    
APlayerData[playerid][Mortes],
    
APlayerData[playerid][FACCOES],
    
APlayerData[playerid][Vip],
    
APlayerData[playerid][Dono],
    
APlayerData[playerid][DJ],
    
APlayerData[playerid][Fogueteiro],
    
APlayerData[playerid][Lider],
    
APlayerData[playerid][PCRJ],
    
APlayerData[playerid][PMRJ],
    
APlayerData[playerid][BOPE],
    
APlayerData[playerid][Reporter],
    
APlayerData[playerid][pHelper],
    
APlayerData[playerid][Logou],
    
APlayerData[playerid][Preso],
    
APlayerData[playerid][Fogos],
    
APlayerData[playerid][CMD],
    
APlayerData[playerid][LLL],
    
APlayerData[playerid][TCP],
    
APlayerData[playerid][MLC],
    
APlayerData[playerid][MTX],
    
APlayerData[playerid][Iniciante],
    
APlayerData[playerid][Dinheiro],
    
APlayerData[playerid][FRENTE],
    
APlayerData[playerid][Vapor],
    
APlayerData[playerid][ID]);
    
mysql_tquery(mysqlQuery,"DadosSalvos","d"playerid); // consulta, e enviamos o resultado para a callback DadosSalvos para um DEBUG 
to ficando louca ja quase o dia todo tentando ageitar isso


Re: Erro mysql - willttoonn - 22.08.2016

Vocк esqueceu de por lб embaixo o APlayerData[playerid][Gerente] ou o que vocк define como variбvel o gerente antes do APlayerData[playerid][ID].


Respuesta: Erro mysql - SammyJ - 22.08.2016

PHP код:
new Query[507]; // variavel com 507 celulas para salvamento
       
mysql_format(mysqlQuerysizeof(Query), "UPDATE `Contas` SET `Nome`='%s', `Scores`='%d', `Admin`='%d', `Skin`='%d', `Matou`='%d', `Mortes`='%d', `FACCOES`='%d', `Vip`='%d', `Dono`='%d', `DJ`='%d', `Fogueteiro`='%d', `Lider`='%d', `PCRJ`='%d', `PMRJ`='%d', `BOPE`='%d', `Reporter`='%d', `pHelper`='%d', `Logou`='%d', `Preso`='%d', `Fogos`='%d', `CMD`='%d', `LLL`='%d', `TCP`='%d', `MLC`='%d', `MTX`='%d', `Iniciante`='%d', `Dinheiro`='%d', `FRENTE`='%d', `Vapor`='%d', `Gerente`='%d' WHERE `ID`='%d'",
    
Nome(playerid),
    
APlayerData[playerid][Scores],
    
APlayerData[playerid][Admin],
    
APlayerData[playerid][Skin],
    
APlayerData[playerid][Matou],
    
APlayerData[playerid][Mortes],
    
APlayerData[playerid][FACCOES],
    
APlayerData[playerid][Vip],
    
APlayerData[playerid][Dono],
    
APlayerData[playerid][DJ],
    
APlayerData[playerid][Fogueteiro],
    
APlayerData[playerid][Lider],
    
APlayerData[playerid][PCRJ],
    
APlayerData[playerid][PMRJ],
    
APlayerData[playerid][BOPE],
    
APlayerData[playerid][Reporter],
    
APlayerData[playerid][pHelper],
    
APlayerData[playerid][Logou],
    
APlayerData[playerid][Preso],
    
APlayerData[playerid][Fogos],
    
APlayerData[playerid][CMD],
    
APlayerData[playerid][LLL],
    
APlayerData[playerid][TCP],
    
APlayerData[playerid][MLC],
    
APlayerData[playerid][MTX],
    
APlayerData[playerid][Iniciante],
    
APlayerData[playerid][Dinheiro],
    
APlayerData[playerid][FRENTE],
    
APlayerData[playerid][Vapor],
    
APlayerData[playerid][Gerente]
    
APlayerData[playerid][ID]);
    
mysql_tquery(mysqlQuery,"DadosSalvos","d"playerid); 



Re: Erro mysql - social - 22.08.2016

vlw foi dei Reputation nos 2 <3