Din $filepath
variabel og din query
skal være i din løkke.
Du bruger også mysql_query
som ikke er kompatibel med mysqli_
funktioner.
Disse to API'er gør ikke blandes sammen. Brug mysqli_query
mens du sender DB-forbindelse til den.
<?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");
}
}