Query string
#5

You have a lot of syntax errors as GRiMMREAPER says and you can't use specifiers as Jefff saiys, the way to do it is combined of GRiMMREAPER and Jefff ideas, you have to format it first and after that you have to connect them together into another string variable using "strcat" function. Try that:
PHP код:
UpdatePlayerData(playerid)
{
    if(
Player[playerid][IsLoggedIn] == false) return 0;
    new 
query[4096];
    new 
query2[4096];
    
format(querysizeof(query), "UPDATE `players` SET `LastLogin` = '%s', `Kills` = '%d', `Deaths` = '%d', `Score` = '%i', `Money` = '%i', `Level` = '%d', `WantedLevel` = '%d', `Skin` = '%d', `PlayerTeam` = '%d', `PlayerGender` = '%d',",
    
ReturnDate(),
    
Player[playerid][Kills],
    
Player[playerid][Deaths],
    
GetPlayerScore(playerid),
    
GetPlayerMoney(playerid),
    
Player[playerid][Level],
    
GetPlayerWantedLevel(playerid),
    
GetPlayerSkin(playerid),
    
GetPlayerTeam(playerid),
    
Player[playerid][PlayerGender]);
    
strcat(query2query);
    
format(querysizeof(query), "`PlayingHours` = '%d', `PlayingMinutes` = '%d', `FirstSpawn` = '%d', `Job` = '%d', `Bank` = '%d', `NoPm` = '%d', `Diseases` = '%d',",
    
Player[playerid][PlayingHours],
    
Player[playerid][PlayingMinutes],
    
Player[playerid][FirstSpawn],
    
Player[playerid][Job],
    
Player[playerid][Bank],
    
Player[playerid][NoPm],
    
Player[playerid][Diseases]);
    
strcat(query2query);
    
format(querysizeof(query), "`VehicleLicense` = '%d', `MotorbikeLicense` = '%d', `PlaneLicense` = '%d', `HelicopterLicense` = '%d', `BankDeposited` = '%d', `BankWithdrawal` = '%d' WHERE `ID`= '%d'",
    
Player[playerid][VehicleLicense],
    
Player[playerid][MotorbikeLicense],
    
Player[playerid][PlaneLicense],
    
Player[playerid][HelicopterLicense],
    
Player[playerid][BankDeposited],
    
Player[playerid][BankWithdrawal],
    
Player[playerid][ID]);
    
strcat(query2query);
    
    
mysql_tquery(g_SQLquery2);
    return 
1;

Reply


Messages In This Thread
Query string - by KinderClans - 09.08.2018, 19:28
Re: Query string - by GRiMMREAPER - 09.08.2018, 20:18
Re: Query string - by KinderClans - 09.08.2018, 23:15
Re: Query string - by Jefff - 09.08.2018, 23:26
Re: Query string - by Kraeror - 10.08.2018, 06:52
Re: Query string - by Banditul18 - 10.08.2018, 07:41
Re: Query string - by Calisthenics - 10.08.2018, 08:21
Re: Query string - by Banditul18 - 10.08.2018, 08:32
Re: Query string - by Juvanii - 10.08.2018, 09:34
Re: Query string - by KinderClans - 10.08.2018, 10:40

Forum Jump:


Users browsing this thread: 1 Guest(s)