<?php
include 'temp/head.php';
include 'temp/navbar.php';
include 'temp/header.php';
//выполним соединение с БД
$mysqli=new mysqli ("localhost", "root", "","stip");
$mysqli->set_charset("utf8");
?>
<div class="container">
<div class="row">
<div class="col">
<form method="POST" role="form" class="form-inline">
<div class="form-group mb-2 col-4">
<select name="ocenk"><br><br>
<?
$sql =$mysqli ->query("select * from student");
while ($row = mysqli_fetch_array($sql))
{
echo '<option value="'.$row['id_stud'].'">'.$row['fio'].'</option>';
}
?>
</select>
</div>
<div class="form-group mb-2 col-4">
<input type="text" class="form-control" name="ocenka" placeholder="Введите оценку" requered>
</div>
<div class="form-group mb-2 col-4">
<button type="submit" class="btn btn-primary">Добавить</button>
</div>
</form>
</div>
</div>
</div>
<?php
if (!empty($_POST))
{
$ocenk=$_POST['ocenk'];
$id_stud=$_POST['id_stud'];
$fio=$_POST['fio'];
$sql = ("insert into student(fio, id_stud) values ('$fio', '$id_stud')");
$resuly=$mysqli->query($sql);
}
?>
<div class="container">
<div class="row">
<table class="table">
<tr>
<th>Номер</th>
<th>Ф.И.О Студента</th>
<th>Оценка</th>
</tr>
<?php
$result= $mysqli->query<b>("select * from gruppa, student where gruppa.id_grup=student.id_grup ORDER BY id_stud");</b><b></b>
while( $row = $result->fetch_array() )
{
echo '<tr><td>'.$row['id_stud'].'</td><td>'.$row['fio'].'</td><td>'.$row['ocenka'].'</td><td>';
}
$result->free();
$mysqli->close();
?>
</table>
</div>
</div>
<?php include 'temp/footer.php';
?>
все вроде работает, но оценку не выводит...может это связанно с запросом?