I have a system where I have a problem I have this code where I just follow inside a youtube video. but change some text. here is my code
<label>Department</label>
<select>
<?php
include 'php/connect.php';
$sql = "SELECT member_type_id FROM member_type";
$result = mysqli_query($conn, $sql);
echo "Select a Department";
while ($row =mysql_fetch_array($result)) {
echo "<option value='" . $row['member_type_id'] ."'>" . $row['member_type_id'] ."</option>";
}
?>
</select>
The problem is, It doesn't show me the value inside that table, here is my database table

the html file is OK, but when I click subit, I always get member registration failed someone correct my code please
<?php
include 'php/connect.php';
$Lname = $_POST['Lname'];
$Fname = $_POST['Fname'];
$Mname = $_POST['Mname'];
$Bdate = $_POST['Bdate'];
$Address = $_POST['Address'];
$Contact = $_POST['Contact'];
$member_type_id = $_POST['Dept'];
$Gender = $_POST['Gender'];
if($Lname == '' OR $Fname == '' OR $Mname =='' OR $Bdate == '' OR $Address =='' OR $Contact =='' OR $Gender =='' OR $member_type_id =='')
{
echo "Fill in all the forms";
}
else {
$sql = "INSERT INTO members (Lname, Fname, Mname, Bdate, Dept, Address, Contact, Gender)
VALUES ('$Lname', '$Fname', '$Mname', '$Bdate',
'$member_type_id', '$Address', '$Contact', '$Gender')";
if ($conn->query($sql) === TRUE)
{
echo "A Member has been added successfully";</script>";
}
else
{
echo "Member Registration Failed"; }
}
$conn->close();
?>
echo "Select a Department";that doesn't look like valid HTML ie<select>Select a Department<option .... ></select>you can't just insert text wily-nilly. Tryecho '<option value="" >Select a Department</option>';