connect_error){ die("Не удалось подключиться к серверу" . $conn->connect_error); } mysqli_set_charset($conn, 'utf8mb4_general_ci'); $sql = 'select * from things'; $result = mysqli_query($conn, $sql); $rows = mysqli_fetch_all($result, MYSQLI_ASSOC); $thingies = []; foreach ($rows as $row) { array_push($thingies, ['id' => $row['id'], 'thing' => $row['thing'], 'parid' => $row['parid'], 'children' => []]); } /*$cheque = []; $chequese = 0; do { foreach ($thingies as $kid) { foreach ($thingies as $kat) { if ($kat['parid'] == $kid['id']) { array_push($kid, } } } } while ($chequese != 0); ?>
'); } $tier = $row['name1']; print (' '); $tiier = ''; foreach ($rows as $row) { if ($row[name2]!=$tiier) { $tiier = $row['name2']; print(''); } } ?> */ ?>