hi im stuck with a delete section in php i want the user to delete single or multiple data using select tag the problem is that it keeps sayin " Undefined index: over in C:\Program Files (x86)\EasyPHP-DevServer-14.1VC11\data\localweb\projects\svsp\delete.php on line 11" heres the code for remove
<select name="service[]" multiple ="yes" required="required" >
<option value="<?php echo $service;?>"><?php echo $service;?></option>
<option value="<?php echo $exservice;?>"><?php echo $exservice;?></option>
</select><br><br>
<a href="delete.php" method="post"><button type="submit" class="btn btn-danger" value="submit ">Delete</button></a>
<br>
and this the delete process where the error is generated
<?php
include 'session.php';
if(!isset($_SESSION['login_user']))
{
header("location:login.php");
}
?>
<?php
$user_check = $_SESSION['login_user'];
$del=$_POST['service'];
$link=mysqli_connect("localhost","root","","sysp");
if($link===false)
{
die("error cant connect".mysqli_connect_error());
}
if (isset($_POST['submit']))
{
$del=$_POST['service'];
}
$change="SELECT service exservice FROM user WHERE email='$user_check' ";
$result=mysqli_query($link,$change);
if(!$result)
{
echo"no column found";
}
else{
$query = "DELETE FROM user WHERE service, exservice='$del'AND email='$user_check'";
$res = mysqli_query($link, $query); // ** actually run the query
if ($res){echo"Service removed successfully";
} else {
echo"service not removed";
}
}
mysqli_close($link);
?>