Here is the code. Where is the mistake???

{ $activate=mysql_query("SELECT * FROM `comm_users` WHERE `id_comm` = '$comm[id]' AND `activate` = '0' AND `id` = '".intval($_GET['yes'])."'"); $activate=mysql_fetch_array($activate);//Пишет ощибку $activate_user=get_user($activate['id_user']); mysql_query("UPDATE `comm_users` SET `activate` = '1' WHERE `id_comm` = '$comm[id]' AND `activate` = '0' AND `id` = '".intval($_GET['yes'])."'"); mysql_query("INSERT INTO `mail` (`id_user`, `id_kont`, `msg`, `time`) VALUES ('0', '$activate_user[id]', '$user[nick] одобрил Вашу заявку на вступление в сообщество [url=/comm/?act=comm&id=$comm[id]]".htmlspecialchars($comm['name'])."[/url].', '$time')"); mysql_query("INSERT INTO `comm_journal` SET `id_comm` = '$comm[id]', `id_user` = '$activate_user[id]', `id_ank` = '$user[id]', `type` = 'in_comm', `time` = '$time'"); msg("Вступительная заявка $activate_user[nick] одобрена"); } 

Reported as a duplicate by Visman participants, Nicolas Chabanovsky Aug 31 '16 at 4:57 .

A similar question was asked earlier and an answer has already been received. If the answers provided are not exhaustive, please ask a new question .

    1 answer 1

    Please stop using the MySQL extension. This extension is deprecated since PHP 5.5.0 and removed in version 7.0. Use MySQLi or PDO_MySQL instead.

    You missed the drain with mysql_result() .

    This error will occur if you have an error in the SQL query.

    To check what the error is, use the code

     $result = mysql_query("SELECT * FROM `comm_users` WHERE `id_comm` = '$comm[id]' AND `activate` = '0' AND `id` = '".intval($_GET['yes'])."'"); if (!$result) { die('Invalid query: ' . mysql_error()); }