Posts: 2,593
Threads: 34
Joined: Dec 2007
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);
Posts: 2,593
Threads: 34
Joined: Dec 2007
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;
Posts: 2,593
Threads: 34
Joined: Dec 2007
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