ユーザー名のmysqlデータベース配列を別のフォームのhtmlドロップダウン入力に表示しようとしているのですが、関数ではなくphpスクリプトが表示され続けます。以下はエラーのスクリーンショットです
http://s10.postimage.org/j4xuamkwp/untitled.png
PHPスクリプトは私のhtmlファイル内に座っています
<?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)
?>
whileループ内の問題だと思いますが、修正できず、非常にイライラします!