TRUNCATE TABLE `accounts`;
Lepiej już
PHP:drop database 'ots';
SELECT * FROM `player_items` WHERE `itemtype` = '2160' and `count` > 10
SELECT * FROM `player_depotitems` WHERE `itemtype` = '2160' and `count` > 10
np.
Code:SELECT * FROM `player_items` WHERE `itemtype` = '2160' and `count` > 10Code:SELECT * FROM `player_depotitems` WHERE `itemtype` = '2160' and `count` > 10
Przeciez softy nie sa 'stackable' (count = 1).
SELECT COUNT(`itemtype`) FROM `player_items` WHERE `itemtype` = 'SOFTY' AND `player_id` = 'ID PLAYERA CO GO SE CHCEM SPRAWDZIC CZY MA DUZO BUTOW CZY TEZ NIE I W OGOLE CZY TRZA USUNAC MU OK?';
DELETE FROM `player_items` WHERE `itemtype` = 'SOFTY' AND `player_id` = 'ID TEGO PLAYERA CO GO SPRAWDZALES BO W OGOLE ON MA BUTY OSZUKANE';
SELECT `id` FROM `players` WHERE `deleted` = 0;
<?php
define('ITEM_ID', 2006);
define('MAX_COUNT', 20);
$players = array();
$sql = new MySQLi('localhost', 'root', 'pass', 'baza');
$ids = $sql->query("SELECT `players`.`id` FROM `players` #WHERE `players`.`deleted` = '0';");
while($id = $ids->fetch_row())
{
if($fetch = $sql->query("SELECT COUNT(`player_items`.`itemtype`) FROM `player_items` WHERE `player_items`.`player_id` = '{$id[0]}' AND `player_items`.`itemtype` = '".ITEM_ID."';")->fetch_row())
$players[$id[0]] = $fetch[0];
}
foreach($players as $id => $count)
if($count >= MAX_COUNT)
{
echo "Deleting {$count} item(s) (".ITEM_ID.") from player {$id}.<br />";
$sql->query("DELETE FROM `player_items` WHERE `player_items`.`itemtype` = '".ITEM_ID."' AND `player_items`.`player_id` = '{$id}';");
}
unset($sql);
?>