4.Php(список фамилий студентов в алфавитном порядке)
«<?php
require_once '../config/connect.php';
$students = mysqli_query($connect, "SELECT `id`, `name`, `surname`, `middlename`, `group` FROM `students` ORDER BY `surname`");
$students = mysqli_fetch_all($students);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="../css/style.css">
<title>Студенты в алфавитном порядке </title>
</head>
<body>
<table>
<tr>
<th>id</th>
<th>Фамилия</th>
<th>Имя</th>
<th>Отчество</th>
<th>Группа</th>
</tr>
<?php
foreach ($students as $item) {
?>
<tr>
<td><?= $item[0] ?></td>
<td><?= $item[2] ?></td>
<td><?= $item[1] ?></td>
<td><?= $item[3] ?></td>
<td><?= $item[4] ?></td>
</tr>
<?php
}
?>
</table>
<form action="../request.php " method="post">
<button type="submit">Назад</button>
</form>
<form action=" / " method="post">
<button type="submit"> Ha главную страницу</button>
</form>
</body>
</html>»
Reguest.php(страница запросов)
«<?php
require_once 'config/connect.php';
$students_id=$_GET['id'];
$student = mysqli_query ($connect,"SELECT * FROM `students` WHERE `id`= '$students_id'");
$student = mysqli_fetch_assoc($student);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="../css/style.css">
<title>Страница запросов</title>
</head>
<body>
<form action="../requests/1.php" method="post">
<button type="submit">Вывести всех студентов из группы КЗИ-212</button>
</form>
<form action="../requests/2.php" method="post">
<button type="submit">Вывести всех студентов из группы КЗИ-211</button>
</form>
<form action="../requests/3.php" method="post">
<button type="submit">Вывести всех студентов группы БИТ-211</button>
</form>
<form action="../requests/4.php" method="post">
<button type="submit">Сортировка по фамилии</button>
</form>
<form action=" / " method="post">
<button type="submit"> Ha главную страницу</button>
</form>
</body>
</html>»