Getting kicked players
#21

pawn Code:
// save
format(query,sizeof(query),"UPDATE `serverinfo` SET `Total_Kicked` = %d", ++totalkicked);
mysql_tquery(mysql,query);

// load
new Cache:result = mysql_query(mysql, "SELECT `Total_Kicked` FROM `serverinfo`");
new tk = cache_get_row_int(0, 0, mysql);
cache_delete(result, mysql);
format(string,sizeof(string),"%s\nTotal kicked players: %d", string, tk);
Reply
#22

Quote:
Originally Posted by Jefff
View Post
pawn Code:
// save
format(query,sizeof(query),"UPDATE `serverinfo` SET `Total_Kicked` = %d", ++totalkicked);
mysql_tquery(mysql,query);

// load
new Cache:result = mysql_query(mysql, "SELECT `Total_Kicked` FROM `serverinfo`");
new tk = cache_get_row_int(0, 0, mysql);
cache_delete(result, mysql);
format(string,sizeof(string),"%s\nTotal kicked players: %d", string, tk);
ok same

my database

Reply
#23

total kicked and banned must be with _ not space

pawn Code:
CREATE TABLE `serverinfo` (
  `Total_Kicked` int(11) NOT NULL,
  `Total_Banned` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
Reply
#24

Quote:
Originally Posted by Jefff
View Post
total kicked and banned must be with _ not space

pawn Code:
CREATE TABLE `serverinfo` (
  `Total_Kicked` int(11) NOT NULL,
  `Total_Banned` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
same
Reply
#25

pawn Code:
CREATE TABLE `serverinfo` (`Total_Kicked` INT(11) UNSIGNED NOT NULL, `Total_Banned` INT(11) UNSIGNED NOT NULL);
INSERT INTO `serverinfo` ( `Total_Kicked` , `Total_Banned` ) VALUES ( 0, 0 );
// save
pawn Code:
mysql_tquery(mysql,"UPDATE `serverinfo` SET `Total_Kicked` = `Total_Kicked` + 1");
load in previous post

see also
https://dev.mysql.com/doc/refman/5.7...duplicate.html
Reply
#26

Quote:
Originally Posted by Jefff
View Post
pawn Code:
CREATE TABLE `serverinfo` (`Total_Kicked` INT(11) UNSIGNED NOT NULL, `Total_Banned` INT(11) UNSIGNED NOT NULL);
INSERT INTO `serverinfo` ( `Total_Kicked` , `Total_Banned` ) VALUES ( 0, 0 );
// save
pawn Code:
mysql_tquery(mysql,"UPDATE `serverinfo` SET `Total_Kicked` = `Total_Kicked` + 1");
load in previous post

see also
https://dev.mysql.com/doc/refman/5.7...duplicate.html
Thanks , also my own codes was good but i didn't insert
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)