By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,664 Members | 1,612 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,664 IT Pros & Developers. It's quick & easy.

Scrolling through Blog Pages

realin
100+
P: 254
hey guyss, whatzz up..

i have joined this forum 10 mins back and i m here with a query, well i jus want to know while i want to display the enteries from my blog, how to i scroll thru pages..

I mean i display the latest five on first page, then do i need to create manually all other pages??

or there is some technique with is followed ???

Thanks a lot
Feb 16 '07 #1
Share this Question
Share on Google+
4 Replies


Motoma
Expert 2.5K+
P: 3,235
hey guyss, whatzz up..

i have joined this forum 10 mins back and i m here with a query, well i jus want to know while i want to display the enteries from my blog, how to i scroll thru pages..

I mean i display the latest five on first page, then do i need to create manually all other pages??

or there is some technique with is followed ???

Thanks a lot
Perhaps you could describe your system a little more thoroughly. It's hard to fix a system which you know nothing about.
Feb 16 '07 #2

realin
100+
P: 254
Perhaps you could describe your system a little more thoroughly. It's hard to fix a system which you know nothing about.

mayne, its jus like this forum you take.. if a thread got 10 or more replies then a next page is created for the further replies.. in the same way, i want to know a way that how do i create a functionality like this ;)

hope its clear now :)
Feb 16 '07 #3

Motoma
Expert 2.5K+
P: 3,235
mayne, its jus like this forum you take.. if a thread got 10 or more replies then a next page is created for the further replies.. in the same way, i want to know a way that how do i create a functionality like this ;)

hope its clear now :)
Well, I understand you are using PHP; however, I have no clue how you are storing the thread information. Are you using a database? MySQL, MSSQL, PostgreSQL, Access, flat file, hard coded html?
Are you using any database classes such as ADODB?
Are you using any template classes, like Smarty or tinytemplate?
Feb 16 '07 #4

Atli
Expert 5K+
P: 5,058
Hi.

If your using a MySQL database, you will most likely have a query where you fetch your data.

You can add to this qery a limit clause, to limit the data it returns to you.
Somwhat like this
[PHP]
// The number of posts to show on each page
$PostsPerPage = 5;

// The number of the page, say you have
// 15 posts and you show 5 per page
// and your user had selected page 2 of 3
$PageNr = 1; // 1 being page number 2 when counting from 0

// Your sql query
$QUERY = "SELECT * FROM mytbl LIMIT " $PostsPerPage * $PageNr .", ". $PostsPerPage;

[/PHP]

If you are not using MySQL you will have to give us much more detail on your system.
Feb 16 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.