I'm working on update user account and my problem is how do i get the value of user type and store it in a combobox or select tag. Here's my code:
<select class="form-control" name="user_type" required>
<option value=''>Select Type</option>
<?php
$query = "SELECT * FROM user_types";
$result = mysqli_query($connections, $query);
while($rows = mysqli_fetch_assoc($result)){
$db_id = $rows["user_type_id"];
$db_desc = $rows["description"];
echo "<option value='$db_id'>$db_desc</option>";
}
?>
</select>
From here i can get all of the user type in my database. Here's my user_types table.
And my users table
My question is how do i get the id and value of the user type based on users table and put that in select tag
Here's i can't get the value of user type