3raser Posted February 20, 2012 Share Posted February 20, 2012 I want to make a time limit in-between posts on my forum. Should I make a table in the database to store the seconds, or read it/write via a file? Quote Link to comment https://forums.phpfreaks.com/topic/257358-should-i-set-a-floodlimit-in-a-file-or-database/ Share on other sites More sharing options...
trq Posted February 20, 2012 Share Posted February 20, 2012 I would have thought the information you need would already be stored in the database on each forum post already. Quote Link to comment https://forums.phpfreaks.com/topic/257358-should-i-set-a-floodlimit-in-a-file-or-database/#findComment-1319109 Share on other sites More sharing options...
3raser Posted February 20, 2012 Author Share Posted February 20, 2012 Sorry if I'm wording this in a way it's hard to understand. I'm going to update the users table and set the lastpost field using microseconds when they make a new post/topic. When they go to make a new post/topic, I need to compare their lastpost to the flood limit time using some simple subtraction. Where should I store the time interval (flood limit time)? A file or database. Quote Link to comment https://forums.phpfreaks.com/topic/257358-should-i-set-a-floodlimit-in-a-file-or-database/#findComment-1319110 Share on other sites More sharing options...
trq Posted February 20, 2012 Share Posted February 20, 2012 I would store that in a database with the rest of your config options. I don't see any need to store a user lastpost time in the users table, you should be able to get this information from your *posts* table. Quote Link to comment https://forums.phpfreaks.com/topic/257358-should-i-set-a-floodlimit-in-a-file-or-database/#findComment-1319112 Share on other sites More sharing options...
3raser Posted February 20, 2012 Author Share Posted February 20, 2012 I would store that in a database with the rest of your config options. I don't see any need to store a user lastpost time in the users table, you should be able to get this information from your *posts* table. The lastpost field in the users table seems like it would be faster, seeing as I'd have to extract their last post time from the threads and posts table. I'm also going to make a "time since last post" feature in the future. And thanks, I'll be using a database. Quote Link to comment https://forums.phpfreaks.com/topic/257358-should-i-set-a-floodlimit-in-a-file-or-database/#findComment-1319114 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.