The php query results are displayed by page. when you click the next page, you cannot remember the queried items. when you click the next page, all the data is displayed.

Source: Internet
Author: User
The php query results are displayed by page. when you click the next page, you cannot remember the queried items. when you click the next page, all the data is displayed.
 [


Reply to discussion (solution)

The query conditions are recorded in the session.
When the next page is clicked, the query condition is read from the session and then queried.

The query conditions are recorded in the session.
When the next page is clicked, the query condition is read from the session and then queried.

Specifically, is $ _ result saved to the session?

You have not passed select in the url

You have not passed select in the url

Can it be specific? Is it added here?
Elseif ($ _ type = 2) {echo'

'; Echo'

    '; Echo'
  • '. $ _ Page.'/'. $ _ pageabsolute.' page |
  • '; Echo'
  • Total'. $ _ Num .'Orders |
  • '; If ($ _ page = 1) {echo'
  • Homepage |
  • '; Echo'
  • Previous Page |
  • ';} Else {echo'
  • Homepage |
  • '; Echo'
  • Previous Page |
  • ';} If ($ _ page ==$ _ pageabsolute) {echo'
  • Next Page |
  • '; Echo'
  • Last page
  • ';} Else {echo'
  • Next Page |
  • '; Echo'
  • Last page
  • ';} Echo'
'; Echo'

';}

There is no need to store Sessions. the most scientific way is to put query conditions on URLs.

The query conditions are recorded in the session.
When the next page is clicked, the query condition is read from the session and then queried.

There is no need to store Sessions. the most scientific way is to put query conditions on URLs.


The query conditions are recorded in the session.
When the next page is clicked, the query condition is read from the session and then queried.

How to implement qiujiao ..

All '. php? Page ='
Changed to '. php? Select = '. $ select.' & page ='

All '. php? Page ='
Changed to '. php? Select = '. $ select.' & page ='

} Elseif ($ _ type = 2) {echo'

'; Echo'

    '; Echo'
  • '. $ _ Page.'/'. $ _ pageabsolute.' page |
  • '; Echo'
  • Total'. $ _ Num .'Orders |
  • '; If ($ _ page = 1) {echo'
  • Homepage |
  • '; Echo'
  • Previous Page |
  • ';} Else {echo'
  • Homepage |
  • '; Echo'
  • Previous Page |
  • ';} If ($ _ page ==$ _ pageabsolute) {echo'
  • Next Page |
  • '; Echo'
  • Last page
  • ';} Else {echo'
  • Next Page |
  • '; Echo'
  • Last page
  • ';} Echo'
'; Echo'

';}

How can I pass $ select_value?

// Obtain the select value
$ Select_value = isset ($ _ GET ['select'])? $ _ GET ['select']: '';

Didn't you write it yourself?

// Obtain the select value
$ Select_value = isset ($ _ GET ['select'])? $ _ GET ['select']: '';

Didn't you write it yourself?

This $ select_value gets the selected status.

Right. with the selection status, you won't be able to run the questions when turning pages.

// Obtain the select value
$ Select_value = isset ($ _ GET ['select'])? $ _ GET ['select']: '';

Didn't you write it yourself?

This $ select_value is used to obtain the selected state. it has nothing to do with that method. The problem now is that when you select a status and go to the next page, it will jump to the second page of all states.

Right. with the selection status, you won't be able to run the questions when turning pages.

Echo'
  • Homepage |
  • ';
    Echo'
  • Previous Page |
  • ';
    }
    If ($ _ page ==$ _ pageabsolute ){
    Echo'
  • Next Page |
  • ';
    Echo'
  • Last page
  • ';
    } Else {
    Echo'
  • Next Page |
  • ';
    Echo'
  • Last page
  • ';
    }
    In this way, the value of $ select_value can be obtained, and the page turning will not be messy and finally solved. Thank you very much ..

    Pass the field content you searched

    Pass the field content you searched

    Well, you have solved it. thank you.

    Session transfer is a method. of course, you can add search conditions to the url.

    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.