Php paging problems (urgent)-php Tutorial

Source: Internet
Author: User
The data read from the database by php paging (urgent) is as follows: Array (& nbsp; [p_id] & gt; 8 & nbsp; [title] & gt; HD test 2 -- my home & nbsp; [d_type] & gt; 0 & nbsp; [c_type] & gt; 29 & nbsp; [user_id] & gt; 50 & nbsp php paging problems (urgent)
The data read from the database is as follows:
Array
(
[P_id] => 8
[Title] => HD test 2 -- my home
[D_type] => 0
[C_type] => 29
[User_id] => 50
[Photo] => Array
(
Http://club.verygood.cn/images/200907/124730234366319.jpg
Http://club.verygood.cn/images/200907/1247302347826.jpg
Http://club.verygood.cn/images/200907/12473023511645.jpg
Http://club.verygood.cn/images/200907/124730235428109.jpg
[4] => http://club.verygood.cn/images/200907/124730235763130.jpg
Http://club.verygood.cn/images/200907/12473023620.jpg
)

[Top_times] => 0
[Views] => 39
[Favorite] => 0
[Brief] => HD test 2 -- my home
[Project_id] => 0
[Tags] =>
[Photo_check] => 1
[Clear] => 1
[Money] => 0
[Download_times] => 0
[Average] => 0
[Add_time] => 1247302371
[Img_url] => http://club.verygood.cn/images/200907/124730234366319.jpg
[Img_128] => http://club.verygood.cn/images/200907/124730234366319_128.jpg
[Img_512] => http://club.verygood.cn/images/200907/124730234366319_512.jpg
[Img_str] => http://club.verygood.cn/images/200907/124730234366319.jpg,http://club.verygood.cn/images/200907/1247302347826.jpg,http://club.verygood.cn/images/200907/12473023511645.jpg,http://club.verygood.cn/images/200907/124730235428109.jpg,http://club.verygood.cn/images/200907/124730235763130.jpg,http://club.verygood.cn/images/200907/12473023620.jpg
)
To display images on the page, the image Array is: [photo] => Array
(
Http://club.verygood.cn/images/200907/124730234366319.jpg
Http://club.verygood.cn/images/200907/1247302347826.jpg
Http://club.verygood.cn/images/200907/12473023511645.jpg
Http://club.verygood.cn/images/200907/124730235428109.jpg
[4] => http://club.verygood.cn/images/200907/124730235763130.jpg
Http://club.verygood.cn/images/200907/12473023620.jpg
)
Problem: to display an image on each page, the home page displays [0] => http://club.verygood.cn/images/200907/124730234366319.jpg
And so on: how to implement paging?

------ Solution --------------------
Using array paging, there are too many code, which looks strange.

Clearly, each page is displayed, so it is not good to use the url to pass the value, and then take the corresponding value for judgment, and use the array to separate the values one by one. it is not necessary to retrieve all the values.
------ Solution --------------------
Refer to some open-source paging functions.
------ Solution --------------------
Watch the php100 video.

------ Solution --------------------
Pass the value according to the URL,
Xxx. php? Page = 1 corresponds to [0]
Xxx. php? Page = 2 corresponds to [1]
.........
------ Solution --------------------
Right. let's take a look at the open source. Good dz

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.