Mysql Problem ( cache_insert_id )
#1

Hi everyone , i'am now creating register/login system and i got a problem with registration , so when i'am logged in with account that i have created ( for example Account ID 17 ) , then i disconnect and reconnect with new account that i will create it In game , i got the same 'CompteID' and when my account save , the stats of my new account will be in the old account, check my PlayerFile_Create

PHP код:
forward PlayerFile_Create(playerid);
public 
PlayerFile_Create(playerid)
{
    
APlayerData[playerid][CompteID] = cache_insert_id();
    
printf("ETAT DU SERVEUR: ENREGISTREMENT D'UN COMPTE ID : %d"APlayerData[playerid][CompteID]);
    return 
1;

Save :

PHP код:
forward PlayerFile_Save(playerid);
public 
PlayerFile_Save(playerid)
{
    new 
query[1024]; 
    
format(querysizeof(query), "UPDATE `users` SET `Level` = %d,"APlayerData[playerid][PlayerLevel]);
    
format(querysizeof(query), "%s `VIP` = %d, `Jailed` = %d, `Wanted` = %d,"queryAPlayerData[playerid][VIPLevel], APlayerData[playerid][PlayerJailed], GetPlayerWantedLevel(playerid));
    
format(querysizeof(query), "%s `Bans` = %d, `BanTime` = %d, `TruckerLicense` = %d,"queryAPlayerData[playerid][Bans], APlayerData[playerid][BanTime], APlayerData[playerid][TruckerLicense]);
    
format(querysizeof(query), "%s `BusLicense` = %d, `PilotLicense` = %d,"queryAPlayerData[playerid][BusLicense], APlayerData[playerid][PilotLicense]);
    
format(querysizeof(query), "%s `MafiaLicense` = %d, `Muted` = %d,"queryAPlayerData[playerid][MafiaLicense], APlayerData[playerid][Muted]);
    
format(querysizeof(query), "%s `RulesRead` = %d, `StatsMetersDriven` = %d, `LastLoggin` = %d,"queryAPlayerData[playerid][RulesRead], APlayerData[playerid][StatsMetersDriven], ReturnDate());
    
format(querysizeof(query), "%s `StatsTruckerJobs` = %d, `StatsConvoyJobs` = %d,"queryAPlayerData[playerid][StatsTruckerJobs], APlayerData[playerid][StatsConvoyJobs]);
    
format(querysizeof(query), "%s `StatsBusDriverJobs` = %d, `StatsPilotJobs` = %d,"queryAPlayerData[playerid][StatsBusDriverJobs], APlayerData[playerid][StatsPilotJobs]);
    
format(querysizeof(query), "%s `StatsMafiaJobs` = %d, `StatsMafiaStolen` = %d,"queryAPlayerData[playerid][StatsMafiaJobs], APlayerData[playerid][StatsMafiaStolen]);
    
format(querysizeof(query), "%s `StatsPoliceFined` = %d, `StatsPoliceJailed` = %d,"queryAPlayerData[playerid][StatsPoliceFined], APlayerData[playerid][StatsPoliceJailed]);
    
format(querysizeof(query), "%s `StatsCourierJobs` = %d, `StatsRoadworkerJobs` = %d,"queryAPlayerData[playerid][StatsCourierJobs], APlayerData[playerid][StatsRoadworkerJobs]);
    
format(querysizeof(query), "%s `StatsAssistance` = %d, `Team` = %d, `Leader` = %d,"queryAPlayerData[playerid][StatsAssistance], APlayerData[playerid][Team], APlayerData[playerid][Leader]);
    
format(querysizeof(query), "%s `Heuresjouer` = %d, `Minutesjouer` = %d,"queryAPlayerData[playerid][pHeures], APlayerData[playerid][pMinutes]);
    
format(querysizeof(query), "%s `Money` = %d, `Score` = %d WHERE `ID` = %d"queryAPlayerData[playerid][PlayerMoney], APlayerData[playerid][PlayerScore], APlayerData[playerid][CompteID]);
    
mysql_format(g_iHandlequerysizeof(query), "%s"query);
    
mysql_tquery(g_iHandlequery); 
    
printf("STATS DU SERVEUR | ENREGISTREMENT MYSQL : %s"query);
    return 
1;

Thank's for reading.
Reply


Messages In This Thread
Mysql Problem ( cache_insert_id ) - by AlexBlack - 14.05.2015, 10:23
Re: Mysql Problem ( cache_insert_id ) - by Konstantinos - 14.05.2015, 10:25
Re : Mysql Problem ( cache_insert_id ) - by AlexBlack - 14.05.2015, 10:38
Re: Mysql Problem ( cache_insert_id ) - by Konstantinos - 14.05.2015, 10:42
Re : Re: Mysql Problem ( cache_insert_id ) - by AlexBlack - 14.05.2015, 10:46
Re : Mysql Problem ( cache_insert_id ) - by AlexBlack - 14.05.2015, 10:51
Re: Mysql Problem ( cache_insert_id ) - by Konstantinos - 14.05.2015, 10:54

Forum Jump:


Users browsing this thread: 1 Guest(s)