Warning: mysql_num_rows (): suppliedargumentisnotavalidMySQLresultresourc

Source: Internet
Author: User
Warning: mysql_num_rows (): suppliedargumentisnotavalidMySQLresultresourc


Untitled Document




 



Include ("conn. php ");
$ SQL = "SELECT * FROM 'liuyanban' order by id desc ";
$ Query = mysql_query ($ SQL );


$ Total = mysql_num_rows ($ query );
$ Pagesize = 3;
$ End_page = ceil ($ total/$ pagesize );
$ Page = $ _ GET ['Page']; // The current page.
If ($ page <= 0)
{
$ Page = 1;
}

If ($ page> $ end_page)
{
$ Page = $ end_page;
}
$ Start = ($ page-1) * $ pagesize;
$ SQL = "select * from liuyanban limit $ start, $ pagesize ";

// Mysql_query ("set names 'gbk '");
$ Ros = mysql_query ($ SQL, $ connect );
?>


Echo "message Table ";
Echo"
";
Echo "current page [$ page], [$ end_page] page ";
If ($ page = 1)
{

?>
Homepage
} Else
{
?>
Homepage


}
?>

"> Previous Page
"> Next page

If ($ page = $ end_page)
{
?>
Last page
} Else
{
?>
"> Last Page
}
?>






























While ($ row = mysql_fetch_array ($ ros )){?> }?>
Member table

Name

Email

Message content

Operation

"> Modify"> Delete


Add member table records






Reply to discussion (solution)

There are always two errors:
Database Connection successful!
Warning: mysql_num_rows (): supplied argument is not a valid MySQL result resource in F: \ phpnew \ htdocs \ hp \ admintxl2.php on line 26

Warning: mysql_fetch_array (): supplied argument is not a valid MySQL result resource in F: \ phpnew \ htdocs \ hp \ admintxl2.php on line 103

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

Could you tell me where to change it?

Change
Unknown column 'id' in 'Order clause'

Thank you. Moderator

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.