Update Banyak

This commit is contained in:
WD - Dev
2025-09-21 21:40:17 +07:00
parent c6bee729c5
commit efca8f5f80
145 changed files with 195185 additions and 1378 deletions
+17
View File
@@ -0,0 +1,17 @@
<?php
include "/www/wwwroot/bilspro/config/connect.php";
// Ambil tanggal awal bulan -1 (bulan sebelumnya)
$date = date('Y-m-01 00:00:00', strtotime('-1 month'));
// Jalankan query DELETE
$stmt = $pdo->prepare("DELETE FROM monitoring_pelanggan
WHERE waktu < :date");
$stmt->execute([':date' => $date]);
// Ambil jumlah data yang dihapus
$delete = $stmt->rowCount();
// Tampilkan hasil
echo "[" . date('Y-m-d H:i:s') . "] " . $delete . " data telah dihapus. Data tersisa sejak " . $date . " sampai sekarang.\n";