Changed my code to this and it now works correctly!
<p>Select Player from dropdown list: (Required) <select id="FullName" name="FullName"
<?php
playerFullName_load()
?>
>
<option disabled selected value> -- select the player -- </option>
</select></p>
and this
function playerFullName_load(){
require '../../configure.php';
$uName = "";
$Surname = "";
$fullName = " ";
$ID = "";
$db_handle = mysqli_connect(DB_SERVER, DB_USER, DB_PASS );
$db_found = mysqli_select_db($db_handle, DB_NAME);
if (!$db_found) {
die("Connection failed: " . mysqli_connect_error());
}
if ($db_found) {
$SQL = "SELECT * FROM `snravalonplayerstb` ORDER BY `FirstName` ASC, `Surname` ASC";
$result = mysqli_query($db_handle, $SQL);
if ($ufullName==" "){}
while ( $db_field = mysqli_fetch_assoc($result) ) {
$uName = $db_field['FirstName'];
$uName = trim($uName);
$Surname = $db_field['Surname'];
$Surname = trim($Surname);
$fullName = $uName." ".$Surname;
$selected = '';
echo "<option value='$fullName' $selected> $fullName </option>";
}
}
else {
print "Database NOT Found ";
}
mysqli_close($db_handle);
}