i was getting this error and this is how i fixed it

i was running a query like this:

$sql = "UPDATE mytable set cunter=counter+1 WHERE id=1";
$result = mysql_query($sql ,$database);
if (!$myrow = mysql_fetch_row($result)) {
echo mysql_errr();
}


Warning: mysql_fetch_row() expects parameter 1 to be resource, boolean given in /www/db.php line 6



ok, the problem here is that you are telling mysql to get a array from your query, but you are not fetching anything from your database so its not going to return anything, when in fact you are just updating data in the database, so you need to use mysql_query() instead of mysql_fetch_row()

so once i changed my code to this, it worked:

$sql = "UPDATE mytable set cunter=counter+1 WHERE id=1";
if (!$mysql_query($sql ,$db)){
echo mysql_errr();
}


no more errors