Date saving to mysql and writing to enum
#1

PHP код:
        new yearmonthday;
        
getdate(year,month,day);
        
format(verslasapID[playerid] ][ vData ], 21,"%02d/%02d/%d"daymonthyear);
        
verslasapID[playerid] ][ vPelnas ] -= money;
        
format(verslasapID[playerid] ][ vThief ], MAX_PLAYER_NAME"%s"getPlayerName(playerid));
        
verslasapID[playerid] ][ vSPelnas ] += money;
        
format(g_szBuffersizeof g_szBuffer"UPDATE "MySQL_BUSINESS_TABLE" SET Pelnas = '%i', Pavogta = '%i', Vagis = '%s', lastData = '%i' WHERE ID = '%i'"verslasapID[playerid] ][ vPelnas ],verslasapID[playerid] ][ vSPelnas ],verslasapID[playerid] ][ vThief ],verslasapID[playerid] ][ vData ], apID[playerid])  ;
        
sql_query(sqlg_szBufferQUERY_THREADED); 
Sorry that code is in Lithuania speach. But vData doesn't saves as it should be. In enum it's : vData[21]
Reply
#2

Change
pawn Код:
lastData = '%i'
to
pawn Код:
lastData = '%s'
Also escape your inputs to prevent SQLi
Reply
#3

Fixed.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)