Quantcast
Channel: SA-MP Forums
Viewing all articles
Browse latest Browse all 18226

MySQL update

$
0
0
Hello guys my updating table is not working :(
Here is my code:
Here is the OnPlayerDisconnect callback:
PHP Code:

mysql_format(zMySQLstringsizeof(string), "SELECT * FROM `accounts` WHERE Username = '%e'"PlayerName(playerid));
mysql_tquery(zMySQLstring"SavePlayersData""d"playerid); 

Here is my SavePlayersData callback:
PHP Code:

forward SavePlayersData(playerid);
public 
SavePlayersData(playerid)
{
    new 
query2[2048];
    
mysql_format(zMySQLquery2sizeof(query2), "UPDATE `accounts` SET `Money` = '%d', `Faction` = '%d', `Rank` = '%d', `Admin` = '%d', `VIP` = '%d', `Marijuana` = '%d', `Cocaine` = '%d', `Heroine` = '%d', `Amphetamine` = '%d', `Extasae` = '%d', `Spawn` = '%d', `aDuty` = '%d', `aList` = '%d', `Language` = '%d' WHERE `Username` = '%e'",
    
PlayerInfo[playerid][Money], PlayerInfo[playerid][Faction], PlayerInfo[playerid][Rank], PlayerInfo[playerid][Admin], PlayerInfo[playerid][VIP], PlayerInfo[playerid][Marijuana], PlayerInfo[playerid][Cocaine], PlayerInfo[playerid][Heroine], PlayerInfo[playerid][Amphetamine], PlayerInfo[playerid][Extasae], PlayerInfo[playerid][Spawn], PlayerInfo[playerid][aDuty], PlayerInfo[playerid][aList], PlayerInfo[playerid][Language], PlayerName(playerid));
    
mysql_query(zMySQLquery2);
    return 
1;



Viewing all articles
Browse latest Browse all 18226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>