Jump to content

Breaking records into pages


Guest

Recommended Posts

Hi guys,

 

I am struggling with some code for a couple of days and can't figure out what to do. I have to admit that I am pretty new at php.

 

Here is my issue. I have a table in my database recording all the news of my website. Pretty simple table with these fields:

  • id
  • menu_name
  • visible
  • content

 

So pretty simple to display all the news on my website. But I guess I will have some trouble when I will have lots of news, showing a long page of news.

 

How can I display these news so that only 10 news appear on page 1 and just below, people can go to other pages?

 

Thanks in advance for your help guys... :)

Link to comment
https://forums.phpfreaks.com/topic/177889-breaking-records-into-pages/
Share on other sites

Hi it's me again...

 

I managed to make the pagination work and I managed to customize it perfectly...

 

The thing is, I have my news displayed on the left of the screen of a edit_subject.php file, with a max of 5 per page. When I want to see the news from 6 to 10, it works well and show edit_subject.php?currentpage=2.

 

But when I click on one subject line to edit it (the edition is on right of the same page), it turns into edit_subject.php?subj=7 (for example), and the pagination goes back to the page 1.

 

So my question would be: how could I do to keep the pagination at the same page where I want to edit my subjects?

 

Sorry for of these questions, I am pretty new to all this...  :-[

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.