Wrong. at home, help me see what's going on.

Source: Internet
Author: User
Sorry, at home, let me see what's going on. I wrote a website program in the local PHP5.3.3 environment.

There is no problem with local testing. Upload to the server. The problem arises. The server is 5.3

I wrote a simple class
Class db {
Function SQL ($ SQL = ''){
Global $ conn;
$ Query = mysql_query ($ SQL );
$ Rs = mysql_fetch_array ($ query); 13 rows
Return $ rs;
Mysql_free_result ($ query );
}
}
$ Db = new db;

No error is reported locally. The upload server reports an error.
PHP Warning: mysql_fetch_array () expects parameter 1 to be resource, boolean given in on line 13

13th rows


Reply to discussion (solution)

12 rows
$ Query = mysql_query ($ SQL) or die (mysql_error ());

You can see it.

The parameter has a problem.

Global $ conn;
The database connection may be faulty.

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.