<?php
include '../../../conn.php';
$checkbox1=$_POST['category'];  
$doctorid=$_POST['id'];
 
foreach($checkbox1 as $chk1)  
{
  $insert = $con->query("INSERT INTO `doctorServices`(`specialtiesId`, `doctorId`) VALUES('$chk1','$doctorid')");
} 
if($insert > 0)
{ 
  echo '<script>window.location.href = "../doctorslist.php";</script>';
}

else{
    
   echo '<script>window.location.href = "../adddoctor.php?id='.$doctorid.'";</script>';
}

?>