$result_allweight = $DB_site->query_first(" SELECT COUNT(field7) AS total FROM " . TABLE_PREFIX . "userfield "); /* $result_allweight['total'] - should return the total value. */