Possible Duplicate:
mysql_fetch_array() expects parameter 1 to be resource, boolean given in select
I have this:
$query=mysql_query("SELECT DISTINCT username FROM messages
WHERE to='admin' AND read='0'");
If I use mysql_fetch_assoc($query) I get the error:
PHP Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given
However, when I remove the following from the SQL statement: AND read='0', there is no error and everything works.
There is something about that "read" column. Its type is "int(1)" with default value 0
Does anyone know why it's doing that? THanks a lot