Re: Show post for x days?
It is generally considered that if you are storing 'public' data (which you are, as it is on a website with users entering the data) that you shouldn't actually delete data, but merely 'hide' it instead - that way you can settle disputes based on the deleted posts if needed.
As you have dates in the table, it would be easy to enough to modify queries to add "AND date < datekill" to the Where clauses, so that only valid posts are shown.
In terms of showing the number of days left, you could calculate it in the query (and return it as part of the recordset), or you could do it in the client app using something like DateDiff in VB.
I would personally do it in the client myself, as the way in which you display it may vary, for example you might start with "x days", and then decide later to have "x days + y hours".
Re: Show post for x days?
Hmmmm, I would have to delete posts eventually because I don't want old posts clogging up my db - if standard time of posting is a month, how long should I keep them after?
Re: Show post for x days?
How huge do you think this application will become? We have systems where I work that literally have millions of records. Think of this forum for example. How many threads/posts do you think there are?
I'm not noticing any degredation of performance because of it. I agree with si_the_geek on this. I wouldn't delete anything. At the most, I would set a status on it and mark it as historical after X days.
And I also wouldn't put a datekill on it. Just run a simple computation based on the created date and today's date like si mentioned.
Re: Show post for x days?
How much storage space do you have, and how much will each post use up?
Based on my memory of your database design, I'm guessing that you won't be running in to trouble anytime soon, a each post is very small in data terms (much less than posts here for example).
I would recommend keeping them for a least a year, and longer (potentially forever) if you have the space.
edit: I think I disagree with you on datekill TheHobo - I think it could be useful, as people could decide how long their post lasts (if that functionality is wanted). Then again, in data-size terms it would probably be better to have a Byte to store the number of days.
Re: Show post for x days?
Well ok guys I think I will keep them in the db for as long as memory permits.... I guess I just want to be economical with space etc..
What I was thinking was just to do a query when showing the posts table and then only show those where datekill > todays date (or something like that lol..)
Anyway thx for the advice, Ill take it onboard ;)