Votre $filepath
variable et votre query
doit être dans votre boucle.
Vous utilisez également mysql_query
qui n'est pas compatible avec mysqli_
fonctions.
Ces deux API ne le font pas mélanger ensemble. Utilisez mysqli_query
tout en lui transmettant la connexion à la base de données.
<?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");
}
}