if(isset($_POST['submit'])){
$patientname = $_POST['patientname'];
$task = $_POST['task'];
$description = $_POST['description'];
$status = $_POST['status'];
$date = date('Y-m-d H:i:s');
$query = $db ->query("INSERT INTO task VALUES('','$patientname', '$task',
'$description', '$status', '$date')");
<form method="post">
<div class="form-group">
<label for="assignedto">Assigned To</label>
<select class="form-control" name="patientname" required>
<option>Select Patient</option>
<?php
$stmt=$dbcon->prepare("SELECT * FROM users");
$stmt->execute();
while($row=$stmt->fetch(PDO::FETCH_ASSOC)){
extract($row);
echo "<option value=''> $type $username $Lastname</optioin>";
}
?
</select>
<button type="submit" class="btn btn-primary" name="submit">Submit</button>
</form>
I don't know whats the problem but when I submit this data to database it shows blank.I hope you can help me guys. that is the output in database.the whole code runs in the same php file