PHP paging Assignment Problems. this helps solve the problem. I attached the code to the php Tutorial.

Source: Internet
Author: User
PHP paging assignment .... it helps solve the problem. added the code to the assignment online & lt; sousuoxianshi. PHP & gt; & lt; divid & quot; connent & quot; & gt; & lt; divid & quot; sousuo & quot; & gt; & lt; formmethod & quot; get & quot; name & quot; form1 & quot; PHP paging assignment .... it helps solve the problem. added code online













(Search for related categories in business cards, such as household management and real estate)

$ Conn = mysql_connect ("localhost", "root", "toma123") or die ("connection error ");
Mysql_select_db ("cs", $ conn );
Mysql_query ("set names 'gbk '");
Mysql_query ("set characher set gb2312 ");
Mysql_query ("set names gb2312 ");
$ Key = $ _ GET ['key'];

?>











$ Conn = mysql_connect ("localhost", "root", "toma123") or die ("connection error ");
Mysql_select_db ("cs", $ conn );
Mysql_query ("set names 'gbk '");
Mysql_query ("set characher set gb2312 ");
Mysql_query ("set names gb2312 ");

$ Md = $ _ GET ['key'];



If ($ md! = ""){

$ SQL = "select * from ud8 where title like '% $ md % '";

$ Result = mysql_query ($ SQL );

$ Sst = mysql_fetch_array ($ result );

$ Num = mysql_num_rows ($ result); // count the number of rows

$ Pages = ceil ($ num/8); // total number of pages

$ Page = $ _ GET ['Page']; // Obtain the page. If no page is set or the page is 0, set $ page to 1;

If ($ page = "")
{
$ Page = 1;
}

$ Start = ($ page-1) * 8;

$ SQL = "select * from ud8 where title like '% $ md %' limit". $ start. ",". 8;

$ Query = mysql_query ($ SQL );

While ($ sumpage = mysql_fetch_array ($ query )){

$ Id = $ sumpage ['id'];

$ Dd = $ id;



?>












Company name

Business introduction

Thumbnail

View business cards

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.