i'm relatively new to this trying to get a mysql database array of Username to be shown in a html drop down input for another form however the php script just keep being shown rather than the function. below is a screenshot of the error
http://s10.postimage.org/j4xuamkwp/untitled.png
the php script is sat within my html file
<?php
$dbhost = 'localhost';
$dbuser = 'root';
$dbpass = '';
$db = 'fid';
$conn = mysql_connect($dbhost,$dbuser,$dbpass);
if (!$conn)
die('Could not connect: ' . mysql_error());
mysql_select_db($db);
echo '<label class="input" for="investigator" type="input">Importance:</label><select id="investigator" name="investigator">';
$resource = mysql_query("SELECT `Username` FROM `user`");
if($resource && mysql_num_rows($resource)) {
while ($row = mysql_fetch_assoc($resource)){
echo '<option value="'.$row['Username'].'">'.$row['Username'].'</option>';
}
}
echo '</select>';
mysql_close($conn)
?>
I think its an issue within the while loop however cannot fix it and its getting very frustrating!