First off hello! Secondly I am trying to get a drop down box to choose it’s default value using an if / elseif statement. This code comes from a alter player page so the information is being pulled from the SQL. Every time I run the script it always outputs male as the default. If someone could shed some light on why this is not working for me or point me in a better direction that would be greatly appreciated.
[php]
$query=“SELECT * FROM player WHERE id = $id”;
$result = mysql_query($query) or die("There was a problem with the SQL query: " . mysql_error());
while($row = mysql_fetch_array($result)){
/** Variables */
$firstname= $row[‘firstname’];
$lastname= $row[‘lastname’];
$sex= $row[‘sex’];
if ($sex = “Male”)
echo "Sex: MaleFemale ";
elseif ($sex = “Female”)
echo "Sex: FemaleMale ";
}[/php]