Show the article title by page in php

Source: Internet
Author: User
In php, how can I display the title on multiple pages? According to my understanding, the important code is openly available. I hope it will help beginners. $ page_size = 10; (number displayed per page) $ SQL = 'selectcount (*) asrntfrommydbf'; $ SQL. = 'How can I display the title of a php post on multiple pages?

According to my understanding, the important code is openly available. I hope it will help beginners.

$ Page_size = 10; (number of entries displayed per page)

$ SQL = 'SELECT count (*) as rnt from mydbf ';

$ SQL. = 'Order by mytime desc ';

$ Qh = mysql_query ($ SQL );

$ Data = mysql_fetch_array ($ qh );

$ Nr = $ data ['cnt '];

$ Pages = intval ($ nr/$ page_size );

If ($ nr % $ page_size) $ pages;

If (empty ($ page ))

{

$ Page = 1;

$ Offset = 0;

}

Else

{

$ Offset = $ page * $ page_size-$ page_size;

}

?>

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.