0) { mysql_query("DELETE FROM `deztow_charstams` WHERE `id` = '".(int)$_GET['delsn']."' AND `name` = '".$_GET['ddname']."' AND `owner` = '".(int)$user['id']."' LIMIT 1"); } if($_POST['name']) { $stats = 83; if($stats == abs($_POST['sila'])+abs($_POST['lovk'])+abs($_POST['inta'])+abs($_POST['vinos'])+abs($_POST['intel'])) { mysql_query("INSERT `deztow_charstams` (`owner`, `name`, `sila`, `lovk`, `inta`, `vinos`, `intel`) VALUES ('".$user['id']."', '".$_POST['name']."', '".abs($_POST['sila'])."', '".abs($_POST['lovk'])."', '".abs($_POST['inta'])."', '".abs($_POST['vinos'])."', '".abs($_POST['intel'])."') ON DUPLICATE KEY UPDATE `sila` = '".abs($_POST['sila'])."', `lovk` = '".abs($_POST['lovk'])."', `inta` = '".abs($_POST['inta'])."', `vinos` = '".abs($_POST['vinos'])."', `intel` = '".abs($_POST['intel'])."'"); echo "Сохранено!".mysql_error(); } else { echo "Что-то не то со статами... сумму проверьте. Необходимо использовать все статы!"; } } $tec = mysql_fetch_array(mysql_query("SELECT `id`, `owner`, `name`, `sila`, `lovk`, `inta`, `vinos`, `intel`, `mudra`, `def` FROM `deztow_charstams` WHERE `owner` = '{$user['id']}' AND `id` = '".(int)$_GET['id']."' LIMIT 1")); if(!isset($tec['id'])) { $tec['sila'] = 3; $tec['lovk'] = 3; $tec['inta'] = 3; $tec['vinos'] = 10; $tec['intel'] = 0; } if($_GET['setdef']){ mysql_query("UPDATE `deztow_charstams` SET `def` = 1 WHERE `owner` = '{$user['id']}' AND `id` = ".(int)$_GET['setdef']." LIMIT 1"); mysql_query("UPDATE `deztow_charstams` SET `def` = 0 WHERE `owner` = '{$user['id']}' AND `id` != ".(int)$_GET['setdef'].""); echo "Сохранено.".mysql_error(); } ?>
Название | По ум. | Удалить | {$row['name']} | ".($row['def']?"По умолчанию":"Установить")." | X | \n"; } ?>