| Server IP : 127.0.0.1 / Your IP : 216.73.216.48 Web Server : Apache/2.4.58 (Win64) OpenSSL/3.1.3 PHP/8.2.12 System : Windows NT DESKTOP-3H4FHQJ 10.0 build 19045 (Windows 10) AMD64 User : win 10 ( 0) PHP Version : 8.2.12 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : D:/xampp/htdocs-coblaa/Cinevaa/ |
Upload File : |
<!--?php
$con = mysqli_connect("localhost", "root", "2019khalaf", "snClipdb");
if (!$con) {
die("Connection failed: " . mysqli_connect_error());
}
// Put this in db.php to auto-expire users
$con->query("UPDATE cine_subscriptiontb SET subscription_status = 'expired' WHERE expiry_date < NOW()");
?-->
<?php
// Fix connection credentials
$con = mysqli_connect("localhost", "root", "2019khalaf", "cinevaadb");
if (!$con) {
die("Connection failed: " . mysqli_connect_error());
}
// 1. Set PHP Timezone
date_default_timezone_set('Africa/Lagos');
// 2. Set MySQL Timezone to match Africa/Lagos (+01:00)
// This ensures NOW() in SQL matches date() in PHP
mysqli_query($con, "SET time_zone = '+01:00'");
// 3. Auto-expire logic using the synchronized time
$con->query("UPDATE cine_subscriptiontb SET subscription_status = 'expired' WHERE expiry_date < NOW()");
?>