I do not understand what the problem is, I checked the request for efficiency, it works without problems.

Notice: Undefined variable: res in /home/m/mukhamwf/hata.test/public_html/reg.php on line 37 Fatal error: callback a function /public_html/reg.php on line 37

//авторизация if(isset($_POST['auth'])){ message::info("Вход на сайт"); $view="SELECT * FROM user_info WHERE user_info.email='$email' LIMIT 0,1"; if($rez=$mysqli->query($view)) {$row = $res->fetch_assoc();}; } 
  • possible problem in the line $ view = "SELECT * FROM user_info WHERE user_info.email = '$ email' LIMIT 0,1"; '$ email' does not check the value of the variable, but the string $ email - vov4ok
  • The problem is not this - because I’ve already manually entered the email, something like this - $ view = "SELECT * FROM user_info WHERE user_info.email='test@mail.ru 'LIMIT 0,1"; - Abdullaev Mohammed
  • Undefined variable: res - what exactly is not clear in this phrase? - Akina
  • Explain condition returns true - Abdullaev Mohammed
  • if ($ reZ = $ mysqli-> query ($ view)) {$ row = $ reS-> fetch_assoc ();}; - vov4ok

1 answer 1

You have a typo in the code. You assign the result to the $ rez variable, and then access $ res. Here is the working code:

 //авторизация if(isset($_POST['auth'])){ message::info("Вход на сайт"); $view="SELECT * FROM user_info WHERE user_info.email='$email' LIMIT 0,1"; if($rez=$mysqli->query($view)) {$row = $rez->fetch_assoc();}; }