<?php
$images = array();
foreach($_FILES['images']['name'] as $key=>$val){        
	$upload_dir = "uploads/";
	$upload_image = $upload_dir.$_FILES['images']['name'][$key];
	$file_name = $_FILES['images']['name'][$key];
	if(move_uploaded_file($_FILES['images']['tmp_name'][$key],$upload_image)){
		$images[] = $upload_image;
		// insert uploaded images details into MySQL database.
		$insert_sql = "INSERT INTO uploads(id, file_name, upload_time) 
			VALUES('', '".$file_name."', '".time()."')";
		mysqli_query($conn, $insert_sql) or die("database error: ". mysqli_error($conn));
	}
}
?>