query('SELECT 1 FROM `users` WHERE `login` = "?s" OR `email` = "?s"', $login, $email)->getNumRows(); if ($check > 0) { $error = "В системе уже есть такие данные!"; } else { db::c()->query('INSERT INTO `users` (`login`,`pass`,`email`,`borndate`,`ip`,`sid`) VALUES ("?s", "?s", "?s", "?s", "?s", "?s")', $login, $password, $email, $birthday, $ip, session_id()); $nid = db::c()->getLastInsertId(); db::c()->query('INSERT INTO `online` (`id`, `date`, `room`) VALUES (?i, ?i, ?i)', $nid, time(), 1); db::c()->query('INSERT INTO `bank` (`id`) VALUES (?i)', $nid, 5); //db::c()->query('UPDATE `users` SET `sid` = "?s" WHERE `id` = ?i', session_id(), $nid); setcookie(GAMEDOMAIN, $nid, time() + 3600); setcookie("battle", time()); $_SESSION['uid'] = $nid; $_SESSION['sid'] = session_id(); header('Location: fight.php'); die(); } } } //******************************************************************************************** // Вот этого куска я не понял. Если что-то пойдёт не так, я буду отталкиваться от него. //session_start(); //setcookie("battle", time()); //$_SESSION['uid'] = $i; //mysql_query("UPDATE `users` SET `sid` = '" . session_id() . "' WHERE `id` = {$i} LIMIT 1"); // //$_SESSION['sid'] = session_id(); //header("Location: fight.php"); //die(); //*********************************************************************************************** ?>