in reply to Message Reply Sequencing
| Table: Messages | |||||
| message_id | recipient_id | sender_id | message | date | status |
| 1 | 500 | 501 | hey mike | 2003-11-02 | NR |
| Table: User | ||
| id | nickname | fullname |
| 500 | bob | Bob |
| 501 | jane | Jane |
After Bob has seen the message (assuming that the message id is saved some where on your web page (hidden field perhaps, or a session variable) -SELECT * FROM messages WHERE recipient_id=? AND status='NR'
And when Bob replies a message back to Jane -UPDATE messages SET status='OK' WHERE message_id = ?
And for the sequencing of message_id's, I normally use a database trigger on INSERT, that queries the table searching for the maximum message_id, add 1, and set as the new message_id. If you don't want to use triggers you could certainly do this easily with SQL and a bit of Perl.$msg = "original message"; # assume this is from the prev message $reply = $newmsg . "\nOriginal Message\n------------\n" . $msg; # and then just insert the reply into messages table with SQL insert INSERT INTO messages (message_id, recipient_id, sender_id, message, date, status) VALUES (?, ?, ?, ?, ?, 'NR')
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Message Reply Sequencing
by Coruscate (Sexton) on Dec 03, 2003 at 06:06 UTC | |
by Roger (Parson) on Dec 03, 2003 at 06:09 UTC | |
by revdiablo (Prior) on Dec 03, 2003 at 06:14 UTC | |
by Roger (Parson) on Dec 03, 2003 at 06:21 UTC | |
by Abigail-II (Bishop) on Dec 03, 2003 at 10:05 UTC | |
| |
by rdfield (Priest) on Dec 03, 2003 at 11:31 UTC |