$query = "SELECT COUNT(*) FROM civicrm_contact"; $total_contacts = CRM_Core_DAO::singleValueQuery($query); echo "Total number of contacts: " . $total_contacts;
$query = "SELECT MAX(total_amount) FROM civicrm_contribution"; $max_contribution = CRM_Core_DAO::singleValueQuery($query); echo "Maximum contribution amount: " . $max_contribution;Package library: The CRM_Core_DAO package is part of the CiviCRM PHP library, which is a collection of open source PHP classes and functions used for building web-based CRM applications. CiviCRM is a popular CRM system for non-profit and civic sector organizations.