这是上传多张图片的代码。
include("../includes/db_connect.php");
$c=count($_FILES[image_name][name]);
if($c<=5)
{
for($i=0; $i<$c; $i++)
{
$img=$_FILES[image_name][name][$i];
if($img)
{
$img_arr=explode(".",$img);
$img=$img_arr[0].".".$img_arr[1];
$img_size=$_FILES[image_name][size][$i]/1024;
$img_type=$_FILES[image_name][type][$i];
$img_ext=$img_arr[1];
$sql="INSERT INTO `university`.`gallary` (`image_name` ,`image_size` ,`image_type` ,`image_ext`)VALUES ( '$img', '$img_size', '$img_type', '$img_ext');";
}
$rs=mysql_query($sql) or die(mysql_error());
move_uploaded_file($_FILES[image_name][tmp_name][$i],"../uploads/gallary/".$_FILES[image_name][name][$i]);
}
header("location:../gallary_view.php?msg=Image Uploaded Successfully!!!");
}
else
{
header("location:../gallary_add.php?msg=Please Upload 5 Image For One Time");
}
?>
在此之后,它为每个图像数据创建单行。我想要单排。怎么做?