= '$current_date' AND car_tracks.created_at < DATE_ADD('$current_date', INTERVAL 1 DAY);"; $stmt = $con->prepare($sql); $stmt->execute(); $car_locations = $stmt->fetchAll(PDO::FETCH_ASSOC); if ($car_locations) { // Print the car location data as JSON jsonSuccess($car_locations); } else { // Print a failure message jsonError($message = "No car locations found"); } ?>