我很难找到错误,它显示查询成功运行但数据库实际上没有更新。该文件已上传到正确的目录中。
$filetemp=$_FILES['dpfile']['tmp_name'];
$filename=$_FILES['dpfile']['name'];
//echo $filetemp;
$filetype=$_FILES['dpfile']['type'];
$filepath="../welcome/dp/".$dept."/".$filename;
move_uploaded_file($filetemp, $filepath);
$sql = "update teachers SET
filename='$filename',
filepath='$filepath',
filetype='$filetype'
WHERE id='$edit_id'";
$reslt = mysqli_query($conn, $sql);
if($reslt)
{
echo "file uploaded successfully";
}
答案 0 :(得分:-1)
尝试
echo $sql = "update teachers SET filename='$filename',
filepath='$filepath', filetype='$filetype'WHERE id='$edit_id'";
die();
查看查询是否正确