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
All Posts | Create New Post
IMPORTANT UPDATE - January 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
180 Views  |  0 Comments

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

» News updates «

» A very Simple Wedding «

» Comedy «

» OBASANJO SACKS STAFFS OF HIS PRESIDENTIAL LIBRARY «

» Mpabbe classified Liverpool as machine «

(» Drop Comment) (» Go Up)

Recommended for you

Welcome To Programming Programming: Perform A Certain Task Everyday (between 24 Hours) Using Php Nuc Approved Universities For Post Graduate Programmes Php: Computer Programming And Security

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.