我正在创建 html 表单,它从表单中获取输入并存储在数据库中,并从用户那里获取图像并存储在同一个表中
我已经在我的表中创建了 BLOB 日期类型的图像字段
但问题是两个任务都不能同时工作
//我的html代码
Scholarship name (association name) :<input type ="text" name ="name"/>
Scholarship type (merit/need) :<input type ="text" name ="type"/>
Amount offer by Scholar ship :<input type ="text" name ="rupees"/>
Last date of submission :<input type ="text" name ="last_date"/>
Number of student that can apply :<input type ="text" name ="total_students"/>
Tagline about scholarship :<input type ="text" name ="tagline"/>
Scholarship criteria(zakaat/profit) :<input type ="text" name ="criteria"/>
Contact number:<input type ="text" name ="cellno1"/>
Email Address:<input type ="text" name ="email"/>
Scholarship description : <TEXTAREA Name="description" ROWS=2 COLS=20></TEXTAREA>
<input type="file" name="file" /> </br>
<input type="submit" value="Upload and submit">
//我的php代码
<?php
$mysql = new mysqli('localhost','root','******','scholarships_system') or die ('you\'re dead');
if(!empty($_POST['submit'])) && (isset($_FILES['file'])== true)) {
$name= $_POST['name'];
$type = $_POST['type'];
$rupees = $_POST['rupees'];
$last_date = $_POST['last_date'];
$total_students = $_POST['total_students'];
$description = $_POST['description'];
$file = $_FILES['file'];
$data = addslashes(file_get_contents($file['tmp_name']));
$myquery="INSERT INTO scholarship_details VALUES('','$name','$type','$rupees','$last_date','$total_students','$description'$data)";
if($update=$mysql->query($myquery)or die($mysql->error)){
echo 'congraxx';
}
}
?>
/// 请帮助我明天是我的代码提交并且没有错误出现