Re: Theory help needed
| From: | Chris Barnes | Date: | Fri, 20 Dec 2002 17:08:51 +0000 |
| Subject: | Re: Theory help needed | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-24323@lists.php.net to get a copy of this message | ||
i'm not experienced so this is just a theory.
if you have a parent id field in your tables then each reply would have
the parent id of the original message they replied to, so when your
program gets the data it will get the original message, and then get any
other messages with the same parent id, then it would move on and get
the next original message...etc.
e.g.
to get original message:
select message_body,message_id from message_table
then to get the threads of the original message:
select message_body,message_id from message_table where
parent_id=[message_id of original message]
i know thats a vague description but its an idea...i guess..
On Fri, 2002-12-20 at 15:23, Chris Payne wrote:
> Hi there everyone,
>
> I have a messageboard which works, but what I need is some kind of threading for it. Right now
> I have EXTREMELY basic threading, where you can reply to a message, reply to replies etc ..... and
> they'll appear in the correct part of the messageboard. What I need though is to be able to do
> proper threading, where each reply appears under the original message and not all over the place,
> but i'm confused as hell.
>
> Anyway have any experience with this kind of thing and can give me a push in the right
> direction? I know I need to store the original ID, the forum ID, the message ID of the current
> message and the ID it relates to, but it's getting confusing :-)
>
> Thanks.
>
> Chris
Attachment: [application/pgp-signature] This is a digitally signed message part signature.asc
Attachment: [application/pgp-signature] This is a digitally signed message part signature.asc