Re: Best way to multi-thread (Kind of)?
| From: | Micah Stevens | Date: | Tue, 19 Aug 2003 02:06:53 +0000 |
| Subject: | Re: Best way to multi-thread (Kind of)? | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-29949@lists.php.net to get a copy of this message | ||
For each message have a autoincrement message ID, an INT field is sufficient I
would guess.
Also in each message record, have a parentID field as INT, default this to 0,
and if the message is a reply to another message, make the parentID = to the
first message's ID field.
When you're displaying titles, query for all messages that have parentID of 0,
then for each one of those, do a second query for a parentID of that message
ID.
I hope that explanation isn't too convoluted. I'm sure there's other possibly
better ways to do it, but that's how I've done it in the past.
-Micah
On Monday 18 August 2003 6:21 pm, Chris Payne wrote:
> Hi there everyone,
>
> I have almost finished my forums system (Thanks for the feedback BTW on
> optimizing the basic query code).
>
> Now that works fine on all 6 forums (Though i've programmed the 6th forum
> differently to allow image uploading and resizing). My question is this, I
> want people to be able to reply to a message and for any messages that have
> replies to have them indented UNDER the original for selection, how can I
> do this?
>
> I know I need a reference to the original message, but i'm not sure how to
> do the indenting etc .... and getting it to display under the original
> posters message.
>
> Any help would be VERY welcome.
>
> Regards
>
> Chris Payne