Possible Duplicate:
mysql_fetch_array() expects parameter 1 to be resource, boolean given in select
Background information:
For SELECT, SHOW, DESCRIBE, EXPLAIN and other statements returning resultset, mysql_query() returns a resource on success, or FALSE on error.
For other type of SQL statements, INSERT, UPDATE, DELETE, DROP, etc, mysql_query() returns TRUE on success or FALSE on error.
If SELECT returns a resource on succes, does it actually return TRUE on succes? So is it still valid to do?:
<?php
$result = mysql_query('SELECT * WHERE 1=1');
if ($result) {
//resultset is valid?
}
?>
I'm almost sure it does, but how does that work? Does mysql_query() just returns several properties?