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
All Posts | Create New Post
IMPORTANT UPDATE - March 2026

PROGRAMMING: Perform a certain task everyday (Between 24 hours) using PHP

Guud Forum / General / News-Politics-Others / PROGRAMMING: Perform a certain task everyday (Between 24 hours) using PHP
188 Views  |  0 Comments

Php: Computer Programming And Security Nuc Approved Universities For Post Graduate Programmes Welcome To Programming
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:


function dailyPoint($db)
{
if(isset($_COOKIE['token23'])){
$token = $_COOKIE['token23'];
$ddd = returnUserDetails($db, $token);

if($ddd != null){
$userId = $ddd['uid'];
$atAll = $ddd['at_all'];
$nextTime = $ddd['next_time'];
$currentTime = time();
$next24 = $currentTime + (24*60*60);
if($atAll == null){
$db->query("update ur34 set awarded_at_all= '1', next_5 = '$next24' where usa45 = '$userId' limit 1");
addPoint($db, 7, $userId);
}
else if($currentTime>=$nextTime){
$db->query("update ur34 set next_5 = '$next24' where usa45 = '$userId' limit 1");
addPoint($db, 7, $userId);
}
return $ddd;
}return null;

}return null;
}


php-code-to-perform-task-each-day-or-24-hours-using-sql-database-programming-naija-best-forum-JPG


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 «

» *I INTERVIEWED A PERSON WHO HATED ME* «

(» Drop Comment) (» Go Up)

Recommended for you

Welcome To Programming Welcome To Webmaster, Programming And Security 774,000 Jobs: Senators, Reps Insist Programme Remains Suspended Php: Computer Programming And Security

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.