SA-MP Forums Archive
HELP! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: HELP! (/showthread.php?tid=477669)



HELP! - cuemur - 25.11.2013

[16:37:39] CMySQLHandler::Query(UPDATE other SET lcnmats='0',yakuzamats='8',rmmats='0',lcnmin='0',y akuzamin='0',rmmin='0',) - An error has occured. (Error ID: 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 код:
stock SaveOther()
{
    new 
src[1024];
    
format(query,sizeof(query),"UPDATE "TABLE_OTHER" SET ");
       
format(src,sizeof(src),"lcnmats='%d',",Mats[16]);
    
strcat(query,src,sizeof(query));
       
format(src,sizeof(src),"yakuzamats='%d',",Mats[17]);
    
strcat(query,src,sizeof(query));
       
format(src,sizeof(src),"rmmats='%d',",Mats[18]);
    
strcat(query,src,sizeof(query));
       
format(src,sizeof(src),"lcnmin='%d',",MafiaMineral[0]);
    
strcat(query,src,sizeof(query));
       
format(src,sizeof(src),"yakuzamin='%d',",MafiaMineral[1]);
    
strcat(query,src,sizeof(query));
       
format(src,sizeof(src),"rmmin='%d',",MafiaMineral[2]);
    
strcat(query,src,sizeof(query));
    
mysql_query(query);




Re: HELP! - ikkentim - 25.11.2013

replace format(src,sizeof(src),"rmmin='%d',",MafiaMineral[2]); with format(src,sizeof(src),"rmmin='%d'",MafiaMineral[2]); (removed the ,)


Re: HELP! - cuemur - 25.11.2013

Now it's -
PHP код:
 CMySQLHandler::Query(UPDATE other SET lcnmats='0'yakuzamats='0'rmmats='0'lcnmin='0'yakuzamin='0'rmmin='0') - An error has occured. (Error ID1064You have an error in your SQL syntaxcheck the manual that corresponds to your MySQL server version for the right syntax to use near 'yakuzamats='0'rmmats='0'lcnmin='0'yakuzamin='0'rmmin='0'' at line 1