Hello all:

I'm trying to make a little message script for my users on my website. It's not exactly a message board but more of a mini e-mail system.

I'm using mysql and DBI for this.

Basically I don't know where to start on creating such a reply system for this lil message script I'm building.

Lets say user "BOB100" messages "MIKEY" saying "Hey Mikey whats up?"

Mikey's homepage would then display a You have a message from Bobby: "Hey Mikey" -read button- / -reply button-

Mikey then hits the reply button and goes to a new page with the message Input form and replys saying "Hey Bob"

Now, on Bobby's homepage it'll say message from Mikey: "Hey Bob" ..............BUT how do I keep the original message from Bob onto the db such as a e-mail reply:

Message from mike : date 11/2/03
Hey Bob

----
Original Message from Bob100 : date 11/1/03
Hey Mikey

And as they keep replying to eachother, the log of all replies continues etc etc...

Basically I'm just stuck on how to set up the mysql DB so I can get this working properly...
I have a mysql db set up as following:
id / touser / createdby / message / date / status 1 mike bob100 heymike 11/2/03 notread

On the homepage to view new messages, the code will be something using a sql statement such as "select * from messages where touser = '$userloggedin'" .... and that will display any new messages for the user.

Is this setup on the right track? I can't seem to implement this reply sequencing option with how I have this db setup, can anyone help or any suggestions?

Thanks,
Anthony

In reply to Message Reply Sequencing by perleager

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.