Ihr $filepath
Variable und Ihre query
muss in deiner Schleife sein.
Sie verwenden auch mysql_query
die nicht mit mysqli_
kompatibel ist Funktionen.
Diese beiden APIs nicht zusammen mischen. Verwenden Sie mysqli_query
beim Weiterleiten der DB-Verbindung.
<?php
$con=mysqli_connect("abc.com","abc","ab","abc");
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
if(isset($_POST['submit']))
{
extract($_POST);
if(isset($_FILES['support_images']['name']))
{
$file_name_all="";
for($i=0; $i<count($_FILES['support_images']['name']); $i++)
{
$tmpFilePath = $_FILES['support_images']['tmp_name'][$i];
if ($tmpFilePath != "")
{
$path = "propertyimages/"; // create folder
$name = $_FILES['support_images']['name'][$i];
$size = $_FILES['support_images']['size'][$i];
list($txt, $ext) = explode(".", $name);
$file= time().substr(str_replace(" ", "_", $txt), 0);
$info = pathinfo($file);
$filename = $file.".".$ext;
if(move_uploaded_file($_FILES['support_images']['tmp_name'][$i], $path.$filename))
{
$file_name_all.=$filename."*";
}
}
$filepath = rtrim($file_name_all, '*').$path;
$query=mysqli_query($con,"INSERT into propertyimages (`propertyimage`) VALUES('".addslashes($filepath)."'); ");
}
}
else
{
$filepath="";
}
if($query)
{
header("Location: admin_profile.php");
}
}