Skip to content

Instantly share code, notes, and snippets.

@agarzon
Created November 2, 2018 21:40
Show Gist options
  • Save agarzon/d30ec15cd965f98b473230d5ae57df36 to your computer and use it in GitHub Desktop.
Save agarzon/d30ec15cd965f98b473230d5ae57df36 to your computer and use it in GitHub Desktop.
WHMCS export hosting services
SELECT tblhosting.domain, tblservers.name, tblhosting.domainstatus, tblproducts.name , CONCAT(tblclients.firstname, ' ', tblclients.lastname) AS Client, tblclients.status AS Clientstatus
FROM tblhosting
LEFT JOIN tblproducts ON tblhosting.packageid = tblproducts.id
LEFT JOIN tblservers ON tblhosting.server = tblservers.id
LEFT JOIN tblclients ON tblhosting.userid = tblclients.id
WHERE tblhosting.domainstatus IN ('Active', 'Suspended')
ORDER BY tblservers.id ASC
INTO OUTFILE '/tmp/whmcs.csv';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment