MySQL SAVE problem
#1

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;
}
Reply
#2

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' 
Reply
#3

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

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

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' 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)