==== Database queries ==== Domains that are expired and should not be renewed select userid,domain,expirydate from tbldomains where donotrenew=1 order by expirydate; Who has credit select clientid,sum(amount) amount from tblcredit group by clientid having amount > 0;