Hi all,
1. I want to delete selected(checkbox) items from database(MySQL). Here I am not getting any error, but I couldn't do the delete function.
2. Wants to play videos in website. Here videos storing into folder and also into database, but cannot playin website.

I tried in many ways, but I couldn't. So, please help to make above mentioned functions workable.

dashboard.php
<form method="post" enctype="multipart/form-data">
<input type="submit" name="delete" class="btn btn-primary" onclick="myFunction(id)" style="font-size: 15px; margin-left: 3em;" value="Delete" />
</form>
<div>
<?php
$query = mysqli_query($database, "SELECT * FROM video");
while($row = mysqli_fetch_assoc($query))
{
$id = $row['id'];
$name = $row['name'];
$url = "../uploads";
// $url = $row['url'];
$fileextensionvalue= $row['fileextension'];
echo "<span class='col-md-6'>
<div class='row'>
<div class='col-md-1'><label class='checkbox'><input style='margin-right:1em;' name='checkbox[<?php echo $id; ?>]' type='checkbox' id='checkbox[]' data-toggle='checkbox' /></label></div>
<div class='col-md-1'><a href='#' style='color:red;font-size:18px;'>$id</a></div>
<div class='col-md-10'><a href='#' style='color:red;font-size:18px;'>$name</a></div>
</div>
<center style='padding:25px;'><video width='320' preload='auto' controls><source src='$url' type='video/$fileextensionvalue;codecs='avc1.42E01E, mp4a.40.2, H.264, aac, FLAC, Opus, VP9, VP8, Vorbis''/></video></center>
</span>";
}
?>
</div>

<script type="text/javascript">
function myFunction(id)
{
var r=confirm("Are you sure to delete selected video/s ?");
if(r==true)
{
window.location.assign("deleteVideo.php?id=" + id);
}
}
</script>

deleteVideo.php
<?php
include '../database/database.php';
$sql = mysqli_query($database, "SELECT * FROM video WHERE id='$id'");
if(empty($_POST['delete']))
{
Print '<script>alert("Please choose file/s to delete.");</script>';
Print '<script>window.location.assign("dashboard.php");</script>';
}
else if(!empty($_POST['delete']))
{
foreach($_POST['checkbox'] as $id => $val)
{
if($val=='checked')
{
$query=mysqli_query("DELETE FROM video WHERE id = '".$id."'");
$result= mysqli_query($database, $query) or die("Invalid query");
}
}
}
?>