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
https://forums.phpfreaks.com/topic/16358-mysql-question/
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
https://forums.phpfreaks.com/topic/16358-mysql-question/#findComment-68026
Share on other sites

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.