<?php
require '../includes/config.php';

$stmt = $mysqli->prepare("
    DELETE u, c
    FROM users u
    JOIN company c ON c.id = u.company_id
    WHERE u.email_verified = 0
      AND u.otp_expires < NOW()
");

$stmt->execute();
?>

<!--ADD THIS CRON JOB- EVERY 5MINS
*/5 * * * * /usr/bin/php /path/to/cleanup-unverified-users.php


-->