Jump to content

mrchimp

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

mrchimp's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks for that. If anyone else is having trouble with this I'd recommend this article
  2. my table structure is up there ^^ i've called it posts, you've called it threads...i've called it replyto, you've called it parentid. What you've said makes sense, but surely that would only work with one depth? I mean if i have post #1, then post #2 with parentid=1 would both be picked, but if there's a post #3 with parentid=2 that wuoldn't be shown
  3. I've only got pseudocode at the moment, but so far i've got something like.... posts database: id, datetime, replyto, userid, content 1, 13/01/2009, NULL, 1, "blah blah blah" 2, 13/01/2009, NULL, 1, "kjhsad" 3, 14/01/2009, 1, 1, "asd asd asd" which i'd like to display as POST 1 POST 3(reply to post 1) POST 2 (new post) So far i'm looking at something like.... SELECT * FROM posts WHERE replyto = NULL foreach{ echo "content id=1" ifexists (posts entry with replyto=1) echo "content id=2" if exists(posts entry with replyto=2) etc.... } But it's getting this bit to loop nicely that I'm having problems with. I had naively hope to be able to use some kind of recursive function like writePost(){ echo "post content" if (reply exists){ writePost($replyid); } } but that doesn't appear to be an option and it also involves an SQL query for each entry, which seems a bit excessive.
  4. Hello everyone I'm trying to make a threaded forum, where each reply sits below the item it was a reply to....(like slashdot.org or b3ta.com. Problem is I can't figure out a neat way of doing this that doesn't involve one SQL query per item. My brain's stuck in an infinite loop on this one, can anyone help? Thans in advance!
×
×
  • 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.