Файл: data/tyrney_infa.php
Строк: 34
<?php
$dbhost="localhost";
$dbname="andking_wk";
$dbuser="andking";
$dbpass="baza1212";
$lin=mysql_connect($dbhost,$dbuser,$dbpass) or die("Не могу подключиться к серверу БД");
mysql_select_db($dbname,$lin) or die("Не могу подключиться к БД");
mysql_query("SET NAMES utf8");
mysql_query("set character_set_client='utf8'");
mysql_query("set character_set_results='utf8'");
mysql_query("set collation_connection='utf8'");
$req = mysql_query("SELECT `id`,`acc`,`ataka`,`zahita` FROM `tyrney_infa` WHERE `tip`='1' LIMIT 1 ");
////////////////////////////
$avto=mysql_num_rows($req);
if($avto==1){
While($mag = mysql_fetch_array($req))
{
mysql_query("UPDATE `account` SET `ataka` =`ataka`- '$mag[ataka]',`zahita` =`zahita`- '$mag[zahita]' WHERE `id` = '$mag[acc]' ");
mysql_query("DELETE FROM `tyrney_infa` WHERE `acc`='$mag[acc]'");
}}
$req1 = mysql_query("SELECT `id`,`acc`,`ataka`,`zahita` FROM `tyrney_infa` WHERE `tip`='2' LIMIT 1 ");
////////////////////////////
$avto=mysql_num_rows($req1);
if($avto==1){
While($mags = mysql_fetch_array($req1))
{
mysql_query("UPDATE `account` SET `ataka` =`ataka`- '$mags[ataka]',`zahita` =`zahita`- '$mags[zahita]' WHERE `id` = '$mags[acc]' ");
mysql_query("DELETE FROM `tyrney_infa` WHERE `acc`='$mags[acc]'");
}}
$req12 = mysql_query("SELECT `id`,`acc`,`ataka`,`zahita` FROM `tyrney_infa` WHERE `tip`='3' LIMIT 1 ");
////////////////////////////
$avto=mysql_num_rows($req12);
if($avto==1){
While($mags2 = mysql_fetch_array($req12))
{
mysql_query("UPDATE `account` SET `ataka` =`ataka`- '$mags2[ataka]',`zahita` =`zahita`- '$mags2[zahita]' WHERE `id` = '$mags2[acc]' ");
mysql_query("DELETE FROM `tyrney_infa` WHERE `acc`='$mags2[acc]'");
}}
?>