Dear teachers, help me to see if I can change it to support paging.

Source: Internet
Author: User
Dear teachers, please help me see if it can be changed to support pagination. & Lt ;? Phpinclude (& quot; Conn/conn. php & quot;); $ query = mysql_query (& quot; selectbook. barcode, book. idasbookid, book. bookn instructors, help me see if I can change it to support pagination.
Include ("Conn/conn. php ");
$ Query = mysql_query ("select book. barcode, book. id as bookid, book. bookname, bt. typename, pb. pubname, bc. name from tb_bookinfo book join tb_booktype bt on book. typeid = bt. id join tb_publishing pb on book. ISBN = pb. ISBN join tb_bookcase bc on book. bookcase = bc. id ");
$ Result = mysql_fetch_array ($ query );
If ($ result = false ){
?>




No book information!






Add book information

} Else {
?>






Add book information
























} While ($ result = mysql_fetch_array ($ query ));}?>
Bar code Book name Book type Press Bookshelves Modify Delete
  ">       "> Modify "> Delete


------ Solution --------------------
It can be changed. There are a lot of code to be changed. it is not difficult to clear the clues from the beginning to the end.
1: What are the page IDs and two parameter-specific URLs? StartPostion = 0 & number = 10
StartPostion start position, number of entries at a time
2: query conditions
$ SqlString = "select * from myTable1 where 1 limit $ startPos, $ num ";
// This sentence is half done.
3: generate the following pages. link between the previous page and the next page
I understand that all of them are physically active.

Have I made it clear?



------ Solution --------------------
The page is actually clear
1. current page
2. number of entries displayed on each page
You can.

Use the preceding two conditions to write SQL statements.

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.