Welcome, Join Guud Forum  Login!

Stats: 2,847 Members  4,424 topics   Date: Thursday 14 May 2026 at 08:39 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 - May 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
201 Views  |  0 Comments

Welcome To Webmaster, Programming And Security Welcome To Programming 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:

» 7 touching cases of rape experienced by men «

» The famous snake catcher:simon «

» Love Matters: She is a year Older than the Guy, Advice Her «

» Lagos State Announces Information On The Resumption Of Schools «

» The MTN staff lady behind you have 1 min remaing «

(» Drop Comment) (» Go Up)

Recommended for you

Welcome To Webmaster, Programming And Security Php: Computer Programming And Security 774,000 Jobs: Senators, Reps Insist Programme Remains Suspended Nuc Approved Universities For Post Graduate Programmes

Sections: Health, Jobs-Business-Investments, How To, News-Politics-Others, Romance, Science and Tech, Phones and Tech Reviews, Fashion, Sport, Celebrity, Gaming, Scholarships, Polytechnics, Travel, College of Education, University, 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.