SA-MP Forums Archive
MySQL SAVE problem - 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: MySQL SAVE problem (/showthread.php?tid=316765)



MySQL SAVE problem - No Fear - 08.02.2012

Hi, i have a problem with my script, it's not saving to table
pawn Код:
stock SaveGlobalLogs( )
{

    new
        Query               [ 200 ],
        sBullets = sGlobal  [ Bullets ],
        sMinutes = sGlobal  [ Minutes ]
    ;

    format( Query, sizeof( Query ), "UPDATE `global` (Bullets,Minutes) VALUES(%d,%d)",
    sBullets, sMinutes );

    mysql_query         ( Query );
    mysql_free_result   ( );
    return true;
}



Re: MySQL SAVE problem - Vince - 08.02.2012

Your syntax is wrong. Refer to dev.mysql.com if unsure about syntax. Correct syntax is:
PHP код:
UPDATE `tablenameSET `field`= 'value', `field2` = 'value' WHERE `field3` = 'value' 



Re: MySQL SAVE problem - No Fear - 08.02.2012

Tried something like that... nop... can you recreate my script?


Re: MySQL SAVE problem - No Fear - 09.02.2012

UP, and i'm not using MySQL player data, it's server logs..


Re: MySQL SAVE problem - Konstantinos - 09.02.2012

The correct syntax at SQL UPDATE Statement is
PHP код:
formatQuerysizeofQuery ), "UPDATE `global` SET `Bullets` = '%d', `Minutes` = '%d'"sBulletssMinutes ); 
That's optional.
PHP код:
WHERE `field3` = 'value'