Possible Duplicate:
PHP: Warning: sort() expects parameter 1 to be array, resource given
I keep getting the following message Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\test\test.class.php on line 22 But when i check the code i can't see what is wrong...
<?php
// Main menu items
$sql=mysql_query("SELECT * FROM category WHERE tier='1' ORDER BY id ASC");
while($row = mysql_fetch_array($sql)){
$p_id= $row["id"];
$p_category_name= $row["category_name"];
$mainMenu[''.$p_category_name.'']= $p_id;
$sql_1=mysql_query("SELECT * FROM category WHERE tier='2' parent='$p_id' ORDER BY id ASC");
while($row_1 = mysql_fetch_array($sql_1)){ **This is line 22**
$c_id= $row_1["id"];
$c_category_name= $row_1["category_name"];
$subMenu[''.$p_category_name.''][''.$c_category_name.''] = 'product1.php';
}
}