Pain Posted November 14, 2011 Share Posted November 14, 2011 Hello guys. I am creating a PHP/mySQL based RPG. I have implemented training feature in it. So i want to make training possible every 15 minutes or so. Can you give me an advice how to achieve that? Thank you! Quote Link to comment https://forums.phpfreaks.com/topic/251151-php-mysql-time-intervals/ Share on other sites More sharing options...
requinix Posted November 15, 2011 Share Posted November 15, 2011 Check when they trained last (which I can only assume you're storing somewhere). If it hasn't been >15 minutes yet then don't let them train. Quote Link to comment https://forums.phpfreaks.com/topic/251151-php-mysql-time-intervals/#findComment-1288181 Share on other sites More sharing options...
Pain Posted November 15, 2011 Author Share Posted November 15, 2011 What function should i use to do that? Quote Link to comment https://forums.phpfreaks.com/topic/251151-php-mysql-time-intervals/#findComment-1288186 Share on other sites More sharing options...
requinix Posted November 15, 2011 Share Posted November 15, 2011 The magic() function. Tell it what you want to do, like magic("make training possible every 15 minutes") Quote Link to comment https://forums.phpfreaks.com/topic/251151-php-mysql-time-intervals/#findComment-1288421 Share on other sites More sharing options...
ManiacDan Posted November 15, 2011 Share Posted November 15, 2011 You should use basic date math, and the greater-than operator. No functions, this can be done in a query assuming your tables are properly set up. What have you tried already? What table structure do you have? What PHP code do you use? Be brief and to the point, but give us something other than "how do I make a click only happen every 15 minutes" Quote Link to comment https://forums.phpfreaks.com/topic/251151-php-mysql-time-intervals/#findComment-1288438 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.