file: /data/sites/www.toptechsmanagement.com.au/web/site/classes/class.database.php line: 60

(abort) sql error performing:

        SELECT 
          CONCAT_WS(" ", TRIM(firstname), IF(TRIM(nickname)!="", CONCAT('"', TRIM(nickname), '"'), NULL), TRIM(lastname), IF(TRIM(suffix)!='', TRIM(suffix), NULL)) AS name,
          TRIM(company) AS company,
          equipment,
          notes,
          IF(LEFT(TRIM(website_href), 3)='www', CONCAT('http://', TRIM(website_href)), TRIM(website_href)) AS website_href,
          IF(LEFT(TRIM(showreel_href), 3)='www', CONCAT('http://', TRIM(showreel_href)), TRIM(showreel_href)) AS showreel_href,
          IF(cv_filename != '', CONCAT('/download/cv/', cv_filename), '') AS cv_filename,
          (SELECT
            GROUP_CONCAT(TRIM(properties.title) SEPARATOR ', ')
            FROM properties LEFT JOIN lookup_table ON properties.id = lookup_table.property_id
            WHERE lookup_table.person_id = p.id
            ) AS properties,
          sb.title AS subsection_head
        FROM
          people p 
          LEFT JOIN lookup_table l ON p.id = l.person_id AND l.subsection_id IS NOT NULL
          LEFT JOIN subsections sb ON sb.id = l.subsection_id
        WHERE
          subsection_id = 14
          AND suspend_flag != '1'
        ORDER BY
          IF(company!='', company, TRIM(lastname)),
          firstname;