I do not understand why this is happening, please help me! Thanks.
Here is my code:
$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>';
}
Here is the error:
Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in /home/content/21/11311721/html/product_display_inlcude.php on line 17
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /home/content/21/11311721/html/product_display_inlcude.php on line 18