08.07.2010, 18:32
So mysql_retrive_row does not fetch data to pawn. So it's a little useless, no?
new field[256],str[256]
mysql_fetch_field_row(field, "NICK");
format(str,256,"Test %s, %d",field,field);
SendClientMessage(playerid,GREY,str);
format(str,256,"Test %s, %d",field,field);
dcmd_loadcar(playerid, params[]){ #pragma unused params if(mysql_stav()){ new query[256]; format(query,sizeof(query),"SELECT * FROM `savecar` WHERE NICK='%s' LIMIT 1",Jmeno(playerid)); mysql_reconnect(); mysql_query(query); mysql_store_result(); if(mysql_ping()>0){ //---------------------------------------------------------------------------------------- new field[256],str[256] mysql_fetch_field_row(field, "Nick"); ... 17 row format(str,256,"Test %s, %d",field,field); // %d I just gave the test because of desperation to find out why it does not //---------------------------------------------------------------------------------------- }else{ mysql_free_result(); SendClientMessage(playerid,RED,"Chyba : Nemбte v DB auto"); } }else{ SendClientMessage(playerid,RED,"Chyba : Server neni spuљtěn"); } return 1; }
if(mysql_ping()>0)
if(mysql_retrieve_row())
[14:53:04] --------------------------- [14:53:04] MySQL Debugging activated (09/19/10) [14:53:04] --------------------------- [14:53:04] [14:53:04] >> mysql_connect( ) [14:53:04] CMySQLHandler::CMySQLHandler() - constructor called. [14:53:04] CMySQLHandler::CMySQLHandler() - Connecting to "localhost" | DB: "x" | Username: "root" ... [14:53:04] CMySQLHandler::Connect() - Connection was successful. [14:53:04] CMySQLHandler::Connect() - Auto-Reconnect has been enabled. [14:54:47] >> mysql_ping( Connection handle: 1 ) [14:54:47] CMySQLHandler::Ping() - Connection is still alive. [15:19:30] >> mysql_ping( Connection handle: 1 ) [15:19:30] CMySQLHandler::Ping() - Connection is still alive. [15:19:30] >> mysql_close( Connection handle: 1 ) [15:19:30] CMySQLHandler::~CMySQLHandler() - deconstructor called. - CRASH [15:21:43] [15:21:43] --------------------------- [15:21:43] MySQL Debugging activated (09/19/10) 15:21:43] --------------------------- [15:21:43] [15:21:43] >> mysql_connect( ) [15:21:43] CMySQLHandler::CMySQLHandler() - constructor called. [15:21:43] CMySQLHandler::CMySQLHandler() - Connecting to "localhost" | DB: "x" | Username: "root" ... [15:21:43] CMySQLHandler::Connect() - Connection was successful. [15:21:43] CMySQLHandler::Connect() - Auto-Reconnect has been enabled. [15:23:41] >> mysql_ping( Connection handle: 1 ) [15:23:41] CMySQLHandler::Ping() - Connection is still alive. [15:27:56] >> mysql_ping( Connection handle: 1 ) [15:27:56] CMySQLHandler::Ping() - Connection is still alive. [15:27:56] >> mysql_close( Connection handle: 1 ) [15:27:56] CMySQLHandler::~CMySQLHandler() - deconstructor called. [15:27:56] CMySQLHandler::FreeResult() - The result is already empty. [15:27:56] CMySQLHandler::Disconnect() - Connection was closed. - DIDN'T CRASH [15:28:08] [15:28:08] --------------------------- [15:28:08] MySQL Debugging activated (09/19/10) [15:28:08] --------------------------- [15:28:08] [15:28:08] >> mysql_connect( ) [15:28:08] CMySQLHandler::CMySQLHandler() - constructor called. [15:28:08] CMySQLHandler::CMySQLHandler() - Connecting to "localhost" | DB: "x" | Username: "root" ... 15:28:08] CMySQLHandler::Connect() - Connection was successful. [15:28:08] CMySQLHandler::Connect() - Auto-Reconnect has been enabled. [15:29:53] >> mysql_ping( Connection handle: 1 ) [15:29:53] CMySQLHandler::Ping() - Connection is still alive. [15:29:53] >> mysql_close( Connection handle: 1 ) [15:29:53] CMySQLHandler::~CMySQLHandler() - deconstructor called.
public OnGameModeExit()
{
print("* Exiting gamemode...");
if(mysql_ping())
mysql_close();
return 1;
}
[01:06:05] CMySQLHandler::Query(UPDATE `players` SET Sex=1,Age=21,Origin=0,DepositDay=0,Level=1,AdminLevel=0,Account=0,Muted=0,Warns=0,ConnectTime=1,Respect=1,Paycheck=281,PayDay=1,Deposit=0,Cash=5000,Bank=2117,SHealth=0.0,Health=76.0,Interior=3,Pos_x=-2025.3,Pos_y=-114.6,Pos_z=1035.1,Virtual=3,Local=255,House=255,Bizz=255,Job=0,Team=3,Member=0,Leader=0,FMember=7,Rank=6,FSkin=0,Model=133,ContractTime=0,DetSkill=0,LawSkill=0,RoadSkill=0,DrugsSkill=0,JackSkill=0,ProfSkill=0,MechSkill=0,GuardSkill=0,GunSkill=0,CarSkill=0,InkasSkill=0,BookmakerSkill=0,TaxiSkill=0,BusSkill=0,CourierSkill=0,TruckSkill=0,FishSkill=0,CookSkill=0,CarLic=11,BikeLic=0,FlyLic=0,BoatLic=0,FishLic=0,GunLic=0,Gun1=0,Ammo1=0,Gun2=0,Ammo2=0,Gun3=0,Ammo3=0,Gun4=0,Ammo4=0,Gun22Skill=0,Gun23Skill=0,Gun24Skill=0,Gun25Skill=0,Gun26Skill=0,Gun27Skill=0,Gun28Skill=0,Gun29Skill=0,Gun30Skill=0,Gun31Skill=0,Gun34Skill=0,HeadValue=0,Wins=0,Loses=0,Kills=0,Deaths=0,Crimes=0,Arrested=0,WantedDeaths=0,Article=0,Part=0,Jailed=0,JailTime=0,JailPrice=0,UpgradePoints=0,AlcoholPerk=0,DrugPerk=0,MiserPerk=0,PainPerk=0,TraderPerk=0,STD=0,Antiradar=0,GPS=0,CDPlayer=0,Dice=0,Drugs=0,Cigars=0,Fishes=0,BiggestFish=0,Fuel=0,LottoNr=0,Materials=0,PhoneNr=0,Phonebook=0,Married=0,MarriedTo='BeSingle',Offline=271,CarTime=0,Tutorial=0,PurposeMurder=0,Referal=0 WHERE Name='Michail_Suvorov') - Successfully executed.
BikeLic=0,FlyLic=0,BoatLic=0,FishLic=0,GunLic=0,Gun1=0,Ammo1=0,Gun2=0,Ammo2=0,Gun3=0,Ammo3=0,Gun4=0,Ammo4=0,Gun22Skill=0,Gun23Skill=0,Gun24Skill=0,Gun25Skill=0,Gun26Skill=0
Sometimes query's didn't executed.. In log:
Код:
[01:06:05] CMySQLHandler::Query(UPDATE `players` SET Sex=1,Age=21,Origin=0,DepositDay=0,Level=1,AdminLevel=0,Account=0,Muted=0,Warns=0,ConnectTime=1,Respect=1,Paycheck=281,PayDay=1,Deposit=0,Cash=5000,Bank=2117,SHealth=0.0,Health=76.0,Interior=3,Pos_x=-2025.3,Pos_y=-114.6,Pos_z=1035.1,Virtual=3,Local=255,House=255,Bizz=255,Job=0,Team=3,Member=0,Leader=0,FMember=7,Rank=6,FSkin=0,Model=133,ContractTime=0,DetSkill=0,LawSkill=0,RoadSkill=0,DrugsSkill=0,JackSkill=0,ProfSkill=0,MechSkill=0,GuardSkill=0,GunSkill=0,CarSkill=0,InkasSkill=0,BookmakerSkill=0,TaxiSkill=0,BusSkill=0,CourierSkill=0,TruckSkill=0,FishSkill=0,CookSkill=0,CarLic=11,BikeLic=0,FlyLic=0,BoatLic=0,FishLic=0,GunLic=0,Gun1=0,Ammo1=0,Gun2=0,Ammo2=0,Gun3=0,Ammo3=0,Gun4=0,Ammo4=0,Gun22Skill=0,Gun23Skill=0,Gun24Skill=0,Gun25Skill=0,Gun26Skill=0,Gun27Skill=0,Gun28Skill=0,Gun29Skill=0,Gun30Skill=0,Gun31Skill=0,Gun34Skill=0,HeadValue=0,Wins=0,Loses=0,Kills=0,Deaths=0,Crimes=0,Arrested=0,WantedDeaths=0,Article=0,Part=0,Jailed=0,JailTime=0,JailPrice=0,UpgradePoints=0,AlcoholPerk=0,DrugPerk=0,MiserPerk=0,PainPerk=0,TraderPerk=0,STD=0,Antiradar=0,GPS=0,CDPlayer=0,Dice=0,Drugs=0,Cigars=0,Fishes=0,BiggestFish=0,Fuel=0,LottoNr=0,Materials=0,PhoneNr=0,Phonebook=0,Married=0,MarriedTo='BeSingle',Offline=271,CarTime=0,Tutorial=0,PurposeMurder=0,Referal=0 WHERE Name='Michail_Suvorov') - Successfully executed.
Uploaded with ImageShack.us It's happened with 20 percent of the players. |