-3
线14
而($行= mysql_fetch_assoc($结果0))警告:mysql_fetch_assoc()预计参数1是资源,对象在C中给出: XAMPP htdocs中 FontLibrary 的index.php上线14
请帮忙。由于
下面是代码
$HOST = 'localhost';
$USERNAME = 'root';
$PASSWORD = '';
$DB = 'Font Library';
$link = mysqli_connect($HOST, $USERNAME, $PASSWORD, $DB) or die(mysqli_connect_error());
if (!$link) {
die(mysqli_error($link));
}
$sql0="SELECT f.id, f.Font_Name, f.Font_Family
FROM font f
GROUP BY f.Font_Family
ASC";
$option = '';
$result0 = mysqli_query($link, $sql0) or die(mysqli_error($link));
while ($row = mysql_fetch_assoc($result0))
{
$option .= '<option value = " '.$row['f.id'].'">'.$row['f.Font_Family'].'</option>';
}
'集团BY' - >'ORDER BY' – BlitZ
我认为你应该使用mysql_fetch_assoc的mysqli_fetch_assoc ... –