Jump to content

MySQL question.


dagnasty

Recommended Posts

If I have a comment system for each so and so piece of content on my site, and the comments are in a seperate table. If the comment table is set up like :


Comment Table:

pagenumber      user          comment                              commentnumber
34                john          Hey, I like to post comments!    305 (auto increment)


and to get the comments for the page:

select * where pagenumber = '$pagenumber'

Would this be the best method for getting the comments if I expect the comments to get into the hundred-thousands?

I really can't think of any other way.

Link to comment
Share on other sites

That is the method I use on one of my sites, [url=http://www.scriptcrawler.net]http://www.scriptcrawler.net[/url].  If you were looking at all the scripts starting with "a" for example, I select them all, then cycle through them picking out the appropriate ones for each page. I compute the first and last item to pull for each page then display it.

My way is a tad complicated though, and I'm not sure if there's a better way.
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.