I see no reason for the two tables. I'd just store the extra info of the second table, in an additional column in the former table. It's just one column! And the relationship is one to one. (Well ok, you could add additional info, like timestamp of deletion and a reason.)
I think you underestimate the power of SQL to just show the content of the posts that were not deleted.
Even if you use 2 tables, the second table (the extra info for deleted posts) needs only contain the post_id and the additional info. Again, SQL can easily join the two tables into a single query (A left join to get all messages, an inner join for the deleted ones). If your database supports views (and I doubt MySQL does, at least the older versions don't), then you can create a view to hold the query, and access it as if it was a single table. Without views, you have to hardcode the join every time, which still isn't so bad.
The redundancy in your approaches are just a major sin against normalisation: you're storing the same info twice, and if something goes wrong, the message text in both versions don't even have to agree.
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.