Welcome, Join Guud Forum Login! Stats: 2,847 Members 4,412 topics Date: Saturday 17 January 2026 at 12:01 AM |
| 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 - January 2026 |
Guud Forum /
General /
News-Politics-Others /
PROGRAMMING: Perform a certain task everyday (Between 24 hours) using PHP
180 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: » News updates « » Comedy « |
|
Sections: How To, Health, News-Politics-Others, Romance, Jobs-Business-Investments, Science and Tech, Phones and Tech Reviews, Gaming, Fashion, Celebrity, Sport, Polytechnics, Scholarships, University, College of Education, Travel, 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. |