Warning: mysql_fetch_* expects parameter 1 to be resource, boolean given error [duplicate]

Possible Duplicate:
How to fix this error “mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in”?

This is a canonical answer intended address this very common question. Any questions pertaining to this error message should be closed as a duplicate of this one.

When using MySQL I am getting an error when using mysql_fetch_array() or mysql_fetch_assoc(). The error message is:

mysql_fetch_array() expects parameter 1 to be resource

or

mysql_fetch_assoc() expects parameter 1 to be resource

发表评论

电子邮件地址不会被公开。 必填项已用*标注