我正在尝试从数据库中检索数据并从中填充列表,我的代码中似乎没有错误,但列表仍然没有填充,我的代码
<?php
$hostname = "localhost";
$username = "username";
$password = "password";
$dbase = "db";
$link = @ mysql_connect($hostname, $username, $password);
$db_selected = @ mysql_select_db($dbase);
?>
<?php
include("scripts/dbconnect.php");
$query="select class from school";
$result=mysql_query($query);
$numrows=mysql_num_rows($result);
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)){
echo '<option value="'.$row['class'].'">'.$row['class'].'</option>';
}
?>
非常感谢任何帮助,谢谢