I’m trying to run a .php file x in x minutes with crontab.
Sometimes it works but mostly not…
For now im just trying to do a connection to a database and insert some data.
When i go to the webpage (.php file) it works fine.
Code:
<?php
// db variables $servername = "name";
$username = "username";
$password = "password";
$dbname = "dbname"; date_default_timezone_set('WET');
$time = date('H:i:s'); $date = date('Y.m.d');
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "INSERT INTO table (Date, Time, Timestamp, ColumnName) VALUES ('" . $date . "','" . $time . "','123','123')";
$conn->query($sql);
$conn->close();
?>
cron jobs are not working well. i already reported it:
1 Like
Oh … Thank you.
Mine is set on every 5m but seems like it is doing every 10m lol.
Thanks.
system
Closed
4
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.