Code: Select all
CREATE TABLE IF NOT EXISTS `items` ( `id` int(11) NOT NULL AUTO_INCREMENT, `player_id` int(9) NOT NULL, `item_id` int(9) NOT NULL, `item_amount` int(11) NOT NULL, PRIMARY KEY (`id`),) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_lithuanian_ci AUTO_INCREMENT=0 ;
Code: Select all
INSERT INTO `%s` (`player_id`, `item_id`, `item_amount`) VALUES ('%d', '%d', '%d') ON DUPLICATE KEY UPDATE `item_amount`='%d';
Bandžiau dėti unique indexus ant jų, bet gaunas kad tik pagal `player_id` žiūri, o ne pagal abu:/