Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9225735
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T04:39:21+00:00 2026-06-18T04:39:21+00:00

I am a newcomer to php so sorry if this is a lame question

  • 0

I am a newcomer to php so sorry if this is a lame question but I would really love to know how to solve this problem that I can’t get out of my mind.

On every dynamic site there are features like news articles and other kind of user generated lets call them boxed contents. If You surf the page You can see that there are a specified number of articles which are displayed and on the bottom of the page and there are page numbers or arrows that can be used to display older posts.

I would be interested in the process of making something similar to this in php. I am not looking for a ready code because I know that every site is unique but I would like to learn the algorithm. I am looking for the logical structure that solves this.

By that I mean for example I would like to set the maximum number of news articles (boxed contents) displayed on a page. I think I can do this with a loop. That’s not that hard for a single page but How do I solve that if there are about 300 articles and I want to show the 10 most recent on the first page then if the user clicks on the second page/next arrow It loads the other 10 articles which are older and so on.

My theory is If I click the number 2 page link It posts a php code that changes a variable which is used in the mysql query that we used in the article loading form so It loads the articles/boxed contents from a different starting id ( i.e. not 0 but 10 if we click the 2. page link or 20 if we click the 3. page link). The loop starts and It loads the following(previous) 10 articles.

I know that in the database I should calculate backwards when grabbing the article id because the newest article has the highest id always but for explanation I thought the example above is easier to understand and I can show You what I would like to do.

There is a big chance that my theory is totally wrong but I would like to share my thoughts so far.

Sorry if it is an incompetent question I would appreciate any word on this problem.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T04:39:22+00:00Added an answer on June 18, 2026 at 4:39 am

    The way to do this is to leverage the MySQL limit clause with 2 parameters, the start and maximum number of rows to retrieve. In your example, it would be limit *page_number* * 10, 10. Alternatively, you could achieve the same goal in PHP, but I’d suggest keeping the heavy lifting of manipulating data in SQL.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm a complete newcomer to this kind of thing, hence the simple question, but
As a newcomer to iOS, I found that ARC has thus far really helped
I'm a newcomer to Python but I understand that things should not be done
A newcomer to Lisp. I know that (mapcar #'list '(1 2) '(3 4)) will
I am a newcomer to PHP and SimpleXMl. I would not expect false under
I'm still a newcomer to python, so I hope this question isn't inane. The
I'm a Go newcomer, but I have read that Go regulars do not miss
I am a newcomer to python (also very sorry if this is a newb
I'm a newcomer to the idea of aspect-oriented programming but I would like to
I'm a newcomer to Qt, but I'm trying to implement what basically amounts to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.