'Cron Job working on MySQL UPDATE but not on SELECT
I have a cron job running every 5 minutes pointing at this script. If I manually visit the .php page everything runs as expected. However, when the cron runs, it produces an empty $map_clusters array, but at the same time the cron job does update the latter $sys query successfully so I know the database connection is working fine with the cron query. So for some reason the cron job is not successfully running the initial SELECT query. Any ideas what I'm doing wrong here?
$query = "SELECT * FROM map_clusters WHERE project_ref = 'pjm' ";
$result = mysqli_query($connect, $query);
while($row = mysqli_fetch_assoc($result)){
$map_clusters[] = $row;
}
//process $map_clusters here
$sys = "UPDATE system SET do_update_map = '0' ";
mysqli_query($connect, $sys);
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
