--- calling r(), args ---
Array
(
  [0] => 20
  [1] => 45
  [2] => Array
    (
      [0] => SELECT
a.ID AS RECORD_ACCOUNT_ID,
a.AcctName AS RECORD_MASTER_DATABASE,
IF(a.DbseName, a.DbseName, a.AcctName) AS MASTER_DATABASE,
a.UserName AS MASTER_USERNAME,
a.HostName AS MASTER_HOSTNAME,
pivot.Password AS MASTER_PASSWORD,
IF(ctc.FirstName IS NULL, CONCAT(pivot.FirstName,' ',pivot.LastName),pivot.Company) AS adminCompany,
IF(ctc.Email IS NULL, pivot.Email, ctc.Email) AS adminEmail,
IF(ctc.FirstName IS NULL, pivot.FirstName, ctc.FirstName) AS adminFirstName,
IF(ctc.LastName IS NULL, pivot.LastName, ctc.LastName) AS adminLastName,
IF(ctc.FirstName IS NULL, CONCAT(pivot.FirstName,' ',pivot.LastName),pivot.Company) AS companyName,
IF(ctc.Phone IS NULL, pivot.Phone, ctc.Phone) AS companyPhone,
IF(ctc.Fax IS NULL, pivot.Fax, ctc.Fax) AS companyFax,
IF(ctc.Address IS NULL, pivot.Address, ctc.Address) AS companyAddress,
IF(ctc.City IS NULL, pivot.City, ctc.City) AS companyCity,
IF(ctc.State IS NULL, pivot.State, ctc.State) AS companyState,
IF(ctc.Zip IS NULL, pivot.Zip, ctc.Zip) AS companyZip,
m.ID AS mid,
m.Status AS ModuleStatus,
mi.Source AS ExtractConfig
FROM
rbase_account a
LEFT JOIN rbase_userbase pivot ON a.AcctName=pivot.UserName
LEFT JOIN rbase_UserbaseUserbase ub ON pivot.UserName = ub.Parent_UserName AND ub.Type='Primary'
LEFT JOIN rbase_userbase ctc ON Child_UserName=ctc.UserName,
rbase_AccountModules am,
rbase_modules m LEFT JOIN rbase_modules_items mi ON m.ID=mi.Modules_ID AND mi.Types_ID=5
WHERE
a.ID=am.Account_ID AND
am.Modules_ID=m.ID AND
a.AcctName='cpm187' AND
m.SKU='051'
GROUP BY a.AcctName
      [1] => 105
      [2] => 3
    )
  [3] => Array
    (
      [0] => 145
      [1] => Table './relatebase_rfm/rbase_AccountModules' is marked as crashed and should be repaired
    )
  [4] => 
  [5] => passed
)
SQL Error
:
Query failed with the following: (Error #145) Table './relatebase_rfm/rbase_AccountModules' is marked as crashed and should be repaired
(Query: SELECT a.ID AS RECORD_ACCOUNT_ID, a.AcctName AS RECORD_MASTER_DATABASE, IF(a.DbseName, a.DbseName, a.AcctName) AS MASTER_DATABASE, a.UserName AS MASTER_USERNAME, a.HostName AS MASTER_HOSTNAME, pivot.Password AS MASTER_PASSWORD, IF(ctc.FirstName IS NULL, CONCAT(pivot.FirstName,' ',pivot.LastName),pivot.Company) AS adminCompany, IF(ctc.Email IS NULL, pivot.Email, ctc.Email) AS adminEmail, IF(ctc.FirstName IS NULL, pivot.FirstName, ctc.FirstName) AS adminFirstName, IF(ctc.LastName IS NULL, pivot.LastName, ctc.LastName) AS adminLastName, IF(ctc.FirstName IS NULL, CONCAT(pivot.FirstName,' ',pivot.LastName),pivot.Company) AS companyName, IF(ctc.Phone IS NULL, pivot.Phone, ctc.Phone) AS companyPhone, IF(ctc.Fax IS NULL, pivot.Fax, ctc.Fax) AS companyFax, IF(ctc.Address IS NULL, pivot.Address, ctc.Address) AS companyAddress, IF(ctc.City IS NULL, pivot.City, ctc.City) AS companyCity, IF(ctc.State IS NULL, pivot.State, ctc.State) AS companyState, IF(ctc.Zip IS NULL, pivot.Zip, ctc.Zip) AS companyZip, m.ID AS mid, m.Status AS ModuleStatus, mi.Source AS ExtractConfig FROM rbase_account a LEFT JOIN rbase_userbase pivot ON a.AcctName=pivot.UserName LEFT JOIN rbase_UserbaseUserbase ub ON pivot.UserName = ub.Parent_UserName AND ub.Type='Primary' LEFT JOIN rbase_userbase ctc ON Child_UserName=ctc.UserName, rbase_AccountModules am, rbase_modules m LEFT JOIN rbase_modules_items mi ON m.ID=mi.Modules_ID AND mi.Types_ID=5 WHERE a.ID=am.Account_ID AND am.Modules_ID=m.ID AND a.AcctName='cpm187' AND m.SKU='051' GROUP BY a.AcctName)