GetReady Posted March 7, 2010 Share Posted March 7, 2010 Hey, Basically im wondering how i would go about making an item "Timed" in PHP... by timed i mean this item can only be purchased once every 6 hours or so... etc... would it be done via some form of cron job maybe? Im unsure, and information would be greatly appreciated. Many Thanks GetReady Link to comment https://forums.phpfreaks.com/topic/194383-timed-items/ Share on other sites More sharing options...
kavisiegel Posted March 7, 2010 Share Posted March 7, 2010 It sounds like you're using an ecommerce script, so it depends on that.. I'd say you could do a cron job for a mysql query that could set the amount in stock to 1 every 6 hours Link to comment https://forums.phpfreaks.com/topic/194383-timed-items/#findComment-1022539 Share on other sites More sharing options...
trq Posted March 7, 2010 Share Posted March 7, 2010 Another method would just be to store a timstamp every time the item is purchased, then simply check this stamp is older than 6 hours on each purchase, if it is, sell it and reset the timestamp. Link to comment https://forums.phpfreaks.com/topic/194383-timed-items/#findComment-1022582 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.