-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 ... –