Jimmy Bäckström wrote:
>
> Yo!
> I'm thinking of writing a bulletin board and I wonder about threads. I want the
>board to be built on threads but I don't know how to do it. I want it to look
>something like this:
>
> subject 1
> |
> |__ reply1 to 'subject 1'
> | |
> | |__ reply1 to 'reply1 to subject 1'
> | |
> | |__ reply2 to 'reply1 to subject 1'
> |
> |__ reply2 to 'subject 1'
>
> This is important to me so I'm thankful for any help I can get!
>
> //Broder
I did it this way for a vbulletin/ubb style board which also does
threading
thread table has in it a coloumn
thread_counter
messages table has a column thread_order
So say there is thread 1
thread counter goes to 1
order is 1
2nd post someone replies to 1
order is 1.2 (2 comes from thread counter)
3rd post - a reply to 2nd post
order is 1.2.3
4th post - someone replies to 2nd post
order is 1.2.4
and so on and so on
so you can get a threaded view in one sql call.
Im using postggresql., interbase and sybase and to do the creation of
thread orders I use triggers. Working out the ordering directly in php
would really suck - you could get problems with concurrent updates.
I never considered MYsql because of it's lack of triggers, stored
procedures etc etc People say these are uneccessary but I tend to
disagree. They save you a ton of clunky php and help speed things up.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]