Error message of phpmysql_fetch_array () and mysql_fetch_row ??? Novice

Source: Internet
Author: User
Error message of phpmysql_fetch_array () and mysql_fetch_row ??? This is my paging code.
Function setSQL ($ SQL ){
$ Awal = (! Empty ($ _ GET [$ this-> param1]) & is_numeric ($ _ GET [$ this-> param1])? Intval ($ _ GET [$ this-> param1]): 0;
$ Hal = (! Empty ($ _ GET [$ this-> param2]) & is_numeric ($ _ GET [$ this-> param2])? Intval ($ _ GET [$ this-> param2])-1: 0;

$ Src = (preg_match ("/. + FROM. +/", $ SQL ))? "FROM": "from ";
$ Expsql = substr ($ SQL, strpos ($ SQL, $ src) + strlen ($ src), strlen ($ SQL)-1 );

$ Koneksi = mysql_query ("select count (*) FROM". $ expsql );


$ Having = strpos (strtolower ($ expsql), $ condition_ SQL );
If ($ having = false)
{
List ($ jumlah) = mysql_fetch_row ($ koneksi) // The error message is displayed here.
}
Else
{
$ Jumlah = mysql_num_rows ($ koneksi );
}

$ This-> numRows = $ jumlah;

$ Koneksi = mysql_query ($ SQL. "LIMIT $ awal, $ this-> totalRecordPage ");

$ Data = array ();
While ($ row = mysql_fetch_array ($ koneksi) {// The error message [/color]
$ Data [] = $ row;
}



Call the paging
If ($ day = 6) {// 21
$ Date1 = date ("Y-m-d", mktime (0, 0, 0, date ("m"), date ("d ") -date ("w")-0, date ("Y ")));
$ Date2 = date ("Y-m-d H: I: s", mktime (23, 59, 59, date ("m"), date ("d ") -date ("w") + 0, date ("Y ")));
$ SQL = "SELECT a. period, a. type1, a. type2, a. result, a. open_time FROM mme1 _

}
If ($ day = 7) {// 22
$ Date1 = date ("Y-m-d", mktime (0, 0, 0, date ("m"), date ("d ") -date ("w")-0, date ("Y ")));
$ Date2 = date ("Y-m-d H: I: s", mktime (23, 59, 59, date ("m"), date ("d ") -date ("w") + 0, date ("Y ")));
$ SQL = "SELECT a. period, a. type1, a. type2, a. result, a. open_time FROM mme2 _

}
$ Pg = new Pagging ("resulttext2.php? Page = ". $ _ GET ['Page']." ");
$ Pg-> totalRecordPage = 25;
$ Pg-> setSQL ($ SQL );
It seems


Reply to discussion (solution)

What is the error message? Paste it to see.

What are the errors?

Warning: mysql_fetch_row () expects parameter 1 to be resource, boolean given in S: \ website \ malaysia \ config \ page. inc. php on line 111

Warning: mysql_fetch_array () expects parameter 1 to be resource, boolean given in S: \ website \ malaysia \ config \ page. inc. php on line 127

Two pages are displayed on the page. when I click the second page, an error is reported. when I click View log on the second page, only SELECT COUNT (*) FROM is obtained .... If no statement is followed

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.