Mysql error. URGENT! Warning: mysql_fetch_assoc () expectsparameter1toberesource, booleangiveninD: \ wamp1 \ www \ empmanage \ empMain. phponlin mysql error, urgent!
Warning: mysql_fetch_assoc () expects parameter 1 to be resource, boolean given in D: \ wamp1 \ www \ empmanage \ empMain. php on line 37
The code is as follows:
$ SQL = "select * from emp limit". ($ pageNow-1) * $ pageSize. ", $ pageSize ";
$ Res2 = mysql_query ($ SQL, $ conn );
37 rows while ($ row = mysql_fetch_assoc ($ res2 )){
Echo "{$ row ['id']} {$ row ['name']} {$ row ['Grad']}".
"{$ Row ['email ']} {$ row ['salary']}".
"Deleting users and modifying users ";
}
Echo "";
Explain the reason for this sentence.
------ Solution --------------------
It indicates that 36 returns the value of boolen's false instead of resource.
Change row 36 to $ res2 = mysql_query ($ SQL, $ conn) or die (mysql_error ());
What is output?
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service