After the check box submits the client tick, how does the server handle the checked query submitted by the client?

Source: Internet
Author: User
For example, I checked the 1,4,5.
How to get to 1,4,5 on the server side and query out the various types of large and small number each.
The fields of the database are the kid,lb,xh inside the table, where the model is only large, medium, and three values.

Also, how to tick submit data after paging.
For example, I checked the first page of 1,4,5 three, the second page tick, 8,9,12 three, because the paging, you need to turn the page tick, flip the page after the selection of how to submit data, please expert guidance.


Reply to discussion (solution)

check box to set the value to Kid

Server Get Tick Kid
$kidList = $_post[' checks ');
Identify the data from the database with these IDs

To get the data paged, you can use get to bring the parameters over. If the amount of data is small, it is easier to switch pages with JS

Save the paging parameter directly to the session.

check box to set the value to Kid

Server Get Tick Kid
$kidList = $_post[' checks ');
Identify the data from the database with these IDs

To get the data paged, you can use get to bring the parameters over. If the amount of data is small, it is easier to switch pages with JS

Through these IDs, how is the tea cup in the database?
One of the words is select * FROM table where kid=¥kid
But if you check several, how to write it.

check box to set the value to Kid

Server Get Tick Kid
$kidList = $_post[' checks ');
Identify the data from the database with these IDs

To get the data paged, you can use get to bring the parameters over. If the amount of data is small, it is easier to switch pages with JS
Get the way to bring the past, seek the expert pointing ...

$kid =join (', ', $_post[' kid ')
$sql = "SELECT * from table where kid in ($kid)";

1. This should first consider adding or enhancing the search function, as far as possible to exclude the display of irrelevant data
2. You can also display as much data as possible by letting the user set how much data is displayed per page
The above two ways can basically avoid such a problem.

If there is no way to avoid the use of similar "shopping cart" processing, the user selected data stored in a cookie or session
Just implement "Add to Cart", "OK payment" is OK. Get pass-through method is not recommended

In fact, the most important thing is how to name the Name property of your checkbox, and the different names pass through different variables.
It is best to name the array, JS in the onsubmit organization of the group or list submitted

As for pagination, I suggest changing pages in a div+hide way so that you can keep changing pages in the same form
You can also use Ajax to change pages, if Ajax, then simply every time you change the page by the way, the PHP end of the submission, summary and then calculate

The landlord is advised to read more open source code, and basic knowledge.
Like SQL statements Select in these simple statements should understand the next

  • 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.