我得到的错误是mysqli_fetch_assoc()期望参数1在第18行是mysqli_result。我不太明白,因为你可以看到我的mysqli_fetch_assoc()已经有了$ res。所以请看一下我的代码并找出问题所在。感谢
<?php
$dbhost = 'localhost' ;
$username = 'root' ;
$password = '' ;
$db = 'programmes' ;
$link = mysqli_connect("$dbhost", "$username", "$password");
mysqli_select_db($link, $db);
$programme=$_GET["programme"];
if($programme!="")
{
$res=mysqli_query($link, "select * from intakes where intake_id=$programme");
echo "<select>";
while($value = mysqli_fetch_assoc($res))
{
echo "<option>";
echo $value["intake_list"];
echo "</option>";
}
echo "</select>";
}
?>