我不明白为什么会这样,请帮助我!谢谢。
这是我的代码:
$sql1 = mysql_query("SELECT * FROM subcategory WHERE category_id = $currentCategory ORDER BY display_name ASC");
$subCatHtml = '<li class="'.($currentSubCategory == '' ? 'active' : '').'"><a href="?c='.$currentCategory.'">All</a></li>';
$scCount = mysql_num_rows($sql1); // count the output amount
while ($row = mysql_fetch_array($sql1)) {
$subCatHtml .= '<li class="'.($row["id"]==$currentSubCategory ? 'active' : '').'"><a href="?c='.$currentCategory.'&s='.$row["id"].'">'.$row["display_name"].'</a></li>';
}
这是错误:
警告:mysql_num_rows() 期望参数 1 是资源,布尔值在第 17 行的 /home/content/21/11311721/html/product_display_inlcude.php 中给出
警告:mysql_fetch_array() 期望参数 1 是资源,布尔值在 /home/content/21/11311721/html/product_display_inlcude.php 第 18 行给出