I'm beginner in PHP MySQL. I successfully get the value from database in INPUT type but I can't get the data from database in SELECT type:
Here is my sample edit form where Gender & User Type can't output the value from my database:
and here is data from the table I created:
I'm calling the data in my input box by using this code:
<?php $userRow['agentFname']; ?> //$userRow['ROW NAME IN TABLE'];
But I can't call the data where In select box, like Gender: and User Type here is my code of Select box.
*Gender
Male
Female
*User Type
Agent
Team Leader
Admin
解决方案
I already have my own answer to this
Here how I solved this:
if ($userRow['agentGender'] == 'Male') {
echo "Male";
echo "Female";
} else {
echo "Female";
echo "Male";
}
?>