<?php
include("connection.php");
$summernote = $_POST['summernote'];
$head =$_POST['head'];
$txtprice=$_POST['txtprice'];
$date=$_POST['date'];
$new_date = date('d-F-Y', strtotime($date));
$img = addslashes($_POST['img']);
$sql=mysqli_query($conn,"INSERT INTO `news` (`id`,`image`,`heading`,`description`,`date`,`category_id`) VALUES ('','$img','$head','$summernote','$new_date ','$txtprice')");
$a=mysqli_query($conn,"INSERT INTO `news_sub`(`id`,`subimage`,`category`) VALUES ('','$img','$txtprice')");
print "Successfully inserted";`enter code here`
?>
这是表单提交的插入查询。这里我一次选择多个图像。在插入时只插入单个图像值。我想将所有图像名称插入数据库中的单行。