$uploadname=basename($_FILES['file']['name']);//записываем имя файла
$uploadpath='file/'.$uploadname;
if (isset($_POST["fiostud"]) && move_uploaded_file($_FILES['file']['tmp_name'], $uploadpath)) {
$sql = mysqli_query($mysqli, "UPDATE `stud` SET
`fio_stud` = '{$_POST['fiostud']}',
`gruppa` = '{$_POST['gruppa']}',
`vid_rab` = '{$_POST['vidrab']}',
`spec` = '{$_POST['spec']}',
`ocen` = '{$_POST['ocen']}',
`fio_prepod` = '{$_POST['fioprepod']}',
`path` = '$uploadpath',
`date` = '{$_POST['date']}',
`name` = '$uploadname'");
}
@$_POST['vidrab']==''?null:$_POST['vidrab']
$attributes = [
'fio_stud' = $_POST['fiostud'],
'gruppa' = $_POST['gruppa'],
'vid_rab' = $_POST['vidrab'],
'spec' = $_POST['spec'],
'ocen' = $_POST['ocen'],
'fio_prepod' = $_POST['fioprepod'],
'path' = $uploadpath,
'date' = $_POST['date'],
'name' = $uploadname,
];
$query = 'Update stud Set';
function (string $query, array $attributes)
{
foreach ($attributes as $column => $value) {
$query .= !is_null($attribute) ? " {$column} = {$value}," : '';
}
return substr($query, 0, -1);
}