Welcome, Join Guud Forum Login! Stats: 2,847 Members 4,418 topics Date: Tuesday 03 March 2026 at 01:51 PM |
| General: News-Politics-Others, Jobs-Business-Investments, Health, Religion, Romance, How To |
| Science & Technology: Science and Tech, Phones and Tech Reviews |
| Entertainment: Celebrity, Fashion, Sport, Gaming |
| Schools & Education: University, Polytechnics, College of Education, Scholarships, Travel |
| Cryptocurrency: Crypto, Ethereum, BNB, Solana, TON, & Others |
| Webmaster & Security: Security, Programming, Webmasters |
| IMPORTANT UPDATE - March 2026 |
Guud Forum /
General /
News-Politics-Others /
PROGRAMMING: Perform a certain task everyday (Between 24 hours) using PHP
188 Views | 0 Comments
| PROGRAMMING: Perform a certain task everyday (Between 24 hours) using PHP by SirBee(m): Mon 20, April, 2020 03:52pm |
|
In web development and coding, there is always more than one way to get things done.
You don't need to reinvent the wheel though you can always improve on existing solutions. That is what everybody does. Straight to the Post, assuming you want to award points to your users every day, you can either do it at a particular time of each day or simply use the duration of 24 hours to perform the Award task. STEP BY STEP Create 2 Columns 1. Used to store the state of whether user have been awarded point ever before. I named it "awarded_at_all" 2. Used To store the time duration for the day i.e 24 hours duration(60*60*24) = 86400 seconds. I named it next_5 The implication of the below code is that, no matter the number of times it runs, if the conditions are not, the task will never run. If you have any questions, ask in the comment section. Cheers. The PHP Code:
1 Like |
| ... |
Suggested: » Hushpuppi transferred to California for Prosecution « » Nigerian Mother Narrates How Her 4yr old Daughter was Raped... « » How to get a permanent pink lips💋 in just 5 minutes at zero cost-home remedy « » Google Launches ‘Journalism Relief Fund’ Following Facebook « |
|
Sections: News-Politics-Others, Romance, How To, Health, Jobs-Business-Investments, Science and Tech, Phones and Tech Reviews, Gaming, Sport, Celebrity, Fashion, University, College of Education, Scholarships, Travel, Polytechnics, Crypto, Ethereum, BNB, Solana, TON, & Others, Security, Programming, Webmasters, Privacy Policy | Terms & Conditions | Contact Us | About Us | Forum Rules | Sitemap Guud Forum - Copyright © 2019 - 2026. All rights reserved. See How To Advertise.Disclaimer: Every Guud Forum member is solely responsible for anything that he/she posts or uploads on Guud Forum. |