Possible Duplicate:
Warning: mysql_fetch_* expects parameter 1 to be resource, boolean given error
I recently got a work from a client, where I have to change the depreciated php old code to new one. In that code I came across mysql_db_query which I converted into mysql_query but the error was given
mysql_fetch_array expects parameter 1 to be resource, boolean given
//the old code was like:
$result = mysql_db_query($mysql_db,"SELECT Hierarchy FROM MenuSystem WHERE LENGTH(Hierarchy) >= 2 AND LOCATE(" . $_SESSION['AccessLevel'] . ",AccessLevels) <> 0;");
//and my new code is :
$result = mysql_query("SELECT Hierarchy FROM MenuSystem WHERE LENGTH(Hierarchy) >= 2 AND LOCATE(" . $_SESSION['AccessLevel'] . ",AccessLevels) <> 0");
please tell me the problem
it refers to line number 11 where is the end bracket of while loop
while ($row = mysql_fetch_array($result)) {
$ConcatHierarchy .= $row["Hierarchy"];
}