Jump to content

Comments per page design


razorsese

Recommended Posts

So I'm trying to make a comment system so I was wondering

 

It is good to reset the id per page ?!

 

For example

 

id :1 page :1

id:2 page:1

id:1 page:2

id:2 page:2

And so on..

 

And how I deal whit the duplicate ones!?

 

Should I normalize the database?!

(Note:I'm beginner whit database design)

Link to comment
Share on other sites

it's unclear to me what you are trying to do. what are your tables and fields?

 

That being said... ID's should be auto-incrementing... for doing pages you can use pagination which basically uses SQL "limit" to have pull certain records based on the page number you are on:

 

SELECT stuff FROM comments WHERE topicID = $topicID LIMIT $startRow, $commentsPerPage

 

where $startRow depends on what "page" you are on

 

look up "pagination" if this looks like what you need

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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