in reply to Re: Message Board Threading with DBI/MySQL
in thread Message Board Threading with DBI/MySQL

What about inserting, deleting, moving, etc? That would ruin the 'hierarchial' structure if you're not gonna rewrite all child threads :)
I usually stick to less obvious message ID format, like a time & date format (as unique key & incremented if necessary). To solve the pointer to the parent, you can either have a parent 'pointer' in your message ID, or have an actual parent field.

Greetz
Beatnik
... Quidquid perl dictum sit, altum viditur.
  • Comment on Re: Re: Message Board Threading with DBI/MySQL

Replies are listed 'Best First'.
Re: Re: Re: Message Board Threading with DBI/MySQL
by Henri Icarus (Beadle) on Jun 07, 2001 at 17:46 UTC
    If you have to have that kind of flexibility then of course this system doesn't work. But usually, for a message board app, you don't need that. It's a "write once and leave it" kind of application. And let's say you do delete a message, the fact that it's gone doesn't destroy the relationships of all the other messages...
      Even if it has 'child' messages, in case you have some kind of reply system? :) When deleting a message, you should also make sure to delete child messages, since orphan messages will get inaccessible if you dont (which ofcourse take up space, slow down queries, etc)

      Greetz
      Beatnik
      ... Quidquid perl dictum sit, altum viditur.