<?php

# ---------------------------------------------------------
# MARK PACKAGES OF INACTIVE CLIENTS AS CANCELLED
# ---------------------------------------------------------

$query = "SELECT id FROM users WHERE status < 0";
$result = mysql_query($query) or die("ERROR in query: $query");
while (list($userId) = mysql_fetch_row($result)) {
    $update = "UPDATE domains SET status = 3 WHERE domains.customerid = $userId AND domains.status != 3";
    mysql_query($update) or die("ERROR in query: $update");
}
?>