<select class="form-control" name="brid">
<option value="" disabled selected="selected">Choose Branch</option>
<option value="All">All</option>
<?php
require_once '../db/db.php';
$select = $conn->query("SELECT * FROM branches where access = 'User' or access = 'USER' ");
while($row = mysqli_fetch_assoc($select)) {
echo "<option value='".$row['brid']."'>".$row['brid']."</option>";
}
?>
</select>
This is my code for selecting branches, all i want is when i select all value. All the rows in branches table is having a same task.
<?php
require '../db/db.php';
$tkid = $_POST['tkid'];
$brid = $_POST['brid'];
$sdate = $_POST['sdate'];
$edate = $_POST['ddate'];
$tkname = $_POST['tkname'];
$tkdesc = $_POST['tkdesc'];
$noteby = $_POST['noteby'];
$select = $conn->query("SELECT * FROM TASK WHERE tkid = '$tkid'");
$count = mysqli_num_rows($select);
if ($count == 0) {
$query = $conn->query("INSERT INTO TASK (brid,tkid,tkname,tkdesc,sdate,edate,ntby)
VALUES ('$brid','$tkid','$tkname','$tkdesc','$sdate','$edate','$noteby')");
echo "<script>alert('The task is successfully created');</script>";
echo "<script>window.location.assign('../load/atask.php')</script>";
}
else{
echo "<script>alert('The task is already created');</script>";
echo "<script>window.location.assign('../load/atask.php')</script>";
}
?>
This is my insertfile all i want is to insert the data to all user fetched to branches table