SA-MP Forums Archive
mysql dosent save(:() - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: mysql dosent save(:() (/showthread.php?tid=490410)



mysql dosent save(:() - romka - 26.01.2014

[php]]public Savestats(playerid)
{
GetPlayerHealth(playerid, Playerinfo[playerid][pHP]);
GetPlayerArmour(playerid, Playerinfo[playerid][pArmor]);
Playerinfo[playerid][pMoney] = GetPlayerCash(playerid);
Playerinfo[playerid][pSkin] = GetPlayerSkin(playerid);
GetPlayerPos(playerid, Playerinfo[playerid][pPosX], Playerinfo[playerid][pPosY], Playerinfo[playerid][pPosZ]);


format(Query, sizeof(Query), "UPDATE account SET `AdminLevel` = '%d', `Money` = '%d', `HP` = '%f', `Armor` = '%f', `Skin` = '%d', `RPTest` = '%d', `Kate1` = '%d', `Kate2` = '%d', `Kate3` = '%d', `PosX` = '%f', `PosY` = '%f', `PosZ` = '%f', `Fraction` = '%d', `FractionRank` = '%d', `Hospital` = '%d', `Age` = '%d', `Bank` = '%d', `Phone` = '%d', `PhoneNumber` = '%d', `UV` = '%d', `BankPin` = '%i', `IsOnHospital` = '%d' WHERE `Name` = '%s'",


Playerinfo[playerid][pAdminLevel],
Playerinfo[playerid][pMoney],
Playerinfo[playerid]
PHP код:
,
    
Playerinfo[playerid][pArmor],
    
Playerinfo[playerid][pSkin],
    
Playerinfo[playerid][pRPTest],
    
Playerinfo[playerid][pKate1],
    
Playerinfo[playerid][pKate2],
    
Playerinfo[playerid][pKate3],
     
Playerinfo[playerid][pPosX],
    
Playerinfo[playerid][pPosY],
    
Playerinfo[playerid][pPosZ],
    
Playerinfo[playerid][pFraction],
    
Playerinfo[playerid][pFractionRank],
    
Playerinfo[playerid][pHospital],
    
Playerinfo[playerid][pAge],
    
Playerinfo[playerid][pBank],
    
Playerinfo[playerid][pPhone],
    
Playerinfo[playerid][pPhoneNumber],
    
Playerinfo[playerid][pUV],
    
Playerinfo[playerid][pBankPin],
    
Playerinfo[playerid][pIsOnHospital],
    
GetEscName(playerid));
    
mysql_query(Query);
    
format(Querysizeof(Query), "UPDATE account SET `Jobs` = '%d' WHERE `Name` = '%s'",
    
Playerinfo[playerid][pJob],
    
GetEscName(playerid));
    
mysql_query(Query);
    return 
1;




Re: mysql dosent save(:() - Konstantinos - 26.01.2014

After executing a query, print it to debug it:
pawn Код:
mysql_query(Query);
print(Query);
Did Query store the whole message or not? Also check the mysql logs.


Re: mysql dosent save(:() - romka - 26.01.2014

where is the mysql log?


Re: mysql dosent save(:() - Konstantinos - 26.01.2014

There should be a file mysql_log.txt if mysql_debug is enabled (according to your plugin's version).


Re: mysql dosent save(:() - romka - 26.01.2014

no there isent mysql-log.tx


Re: mysql dosent save(:() - romka - 26.01.2014

help please!


Re: mysql dosent save(:() - romka - 26.01.2014

PHP код:
[18:19:21UPDATE kasutajad SET `AdminLevel` = '0', `Money` = '500', `HP` = '100.000000', `Armor` = '0.000000', `Skin` = '7', `RPTest` = '0', `Kate1` = '0', `Kate2` = '0', `Kate3` = '0', `PosX` = '1845.755981', `PosY` = '-1843.883178', `PosZ` = '17.078037', `Fraction` = '0', `FractionRank` = '0', `Hospital` = '0', `Age` = '19', `Bank` = '5000', `Phone` = '0', `PhoneNumber` = '0', `UV` = '0', `BankPin` = '0', `IsOnHospital` = '0' WHERE `Name` = 'Roland_Nevilleaaaa'
[18:19:21UPDATE kasutajad SET `TooID` = '0' WHERE `Nimi` = 'Roland_Nevilleaaaa' 
This Works Put this dosent set it to mysql :S,i taked it from server log.


Re: mysql dosent save(:() - Konstantinos - 26.01.2014

Execute those two queries through phpMyAdmin, if there's anything wrong with the field's name or something else it will most likely inform you.


Re: mysql dosent save(:() - romka - 26.01.2014

PHP код:
--
-- 
Table structure for table `account`
--

CREATE TABLE IF NOT EXISTS `account` (
  `
RegIDint(10NOT NULL auto_increment,
  `
Namevarchar(24NOT NULL,
  `
Passwordvarchar(129NOT NULL,
  `
Moneyint(15NOT NULL default '500',
  `
PosXfloat NOT NULL default '1642.23',
  `
PosYfloat NOT NULL default '-2240.5',
  `
PosZfloat NOT NULL default '13.4952',
  `
Bankint(15NOT NULL default '5000',
  `
AdminLevelint(1NOT NULL default '0',
  `
HPfloat NOT NULL default '100',
  `
Armorfloat NOT NULL default '0',
  `
Skinint(11NOT NULL default '1',
  `
RPTestint(11NOT NULL default '0',
  `
Kate1int(11NOT NULL default '0',
  `
Kate2int(11NOT NULL default '0',
  `
Kate3int(11NOT NULL default '0',
  `
Sexint(11NOT NULL default '0',
  `
Fractionint(11NOT NULL default '0',
  `
FractionRankint(11NOT NULL default '0',
  `
Hospitalint(11NOT NULL default '0',
  `
Ageint(11NOT NULL default '0',
  `
Phoneint(11NOT NULL default '0',
  `
PhoneNumberint(11NOT NULL default '0',
  `
UVint(11NOT NULL default '0',
  `
IsOnHospitalint(11NOT NULL default '0',
  `
BankPinint(11NOT NULL default '0',
  `
Jobint(11NOT NULL default 'Tццtu',
  
PRIMARY KEY  (`RegID`)
ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=294 ;


-- -------------------------------------------------------- 



Re: mysql dosent save(:() - romka - 26.01.2014

help please!