When I try to get a UUID, I get an error

Fatal error: Uncaught Error: Call to a member function fetch_array () on boolean in /var/www/www-root/data/www/hypecraft.ru/engine/modules/banlist/index.php:88 Stack trace: # 0 /var/www/www-root/data/www/hypecraft.ru/engine/classes/templates.class.php(267): include () # 1 [internal function]: dle_template-> load_file (Array) # 2 / var / www / www-root / data / www / hypecraft.ru / engine / classes / templates.class.php (654): preg_replace_callback ('# \ {include file ...', Array, '

Here is the code

<?php if(isset($_POST['add_ban'])){ if($usergroup == '1' || '2'){ $ban_name = $mysqli->real_escape_string($_POST["ban_name"]); $ban_reason = $mysqli->real_escape_string($_POST["ban_reason"]); $time = time(); $time = date("Ymd Gis", $time); if($mysqli->real_escape_string($_POST['perm']) == "ban_perm"){ $ban_time = '0'; }else{ $ban_time = time(); $sutk = $mysqli->real_escape_string($_POST["sutk"]); $sutk = $sutk * 24 * 60 * 60; $hour = $mysqli->real_escape_string($_POST["hour"]); $hour = $hour * 60 * 60; $min = $mysqli->real_escape_string($_POST["min"]); $min = $min * 60; $ban_time = $ban_time + $sutk + $hour + $min; $ban_time = date("Ymd Gis", $ban_time); }; /* return name of current default database */ $uuid = $mysqli->query("SELECT * FROM dle_users WHERE username='$ban_name'"); while($uuids = $uuid->fetch_array()){ $uuids1 = $uuids['uuid']; $mysqli->query("INSERT INTO $db_table (name, uuid, reason, admin, time, temptime) VALUES ('$ban_name', '$uuids1', '$ban_reason', '$username', '$time', '$ban_time')"); } }else{ echo "Ошибка! У вас нет доступа!"; } } ?> 
  • Maybe you just have no data from the database, before the cycle, check if $ uuid is empty - Arsen
  • The point is that I specify a nickname that has a uuid. and gives an error! - Kolya Gensul
  • put the logic of the loop in if (! empty ($ uuid)) {... while () {} .....} - Arsen
  • Added, all the same error! - Kolya Genzul
  • Have you ever checked what $ uuid displays? var_dump () at least do it, maybe it is not empty but there is no data for brute force !! - Arsen

0