function getProviderCategories($providerId) { $categories = array(); $sql = "SELECT DISTINCT category_id\n FROM \t\t service_category_cache AS scc\n INNER JOIN\t service as s ON scc.service_id = s.id\n WHERE\t\t s.active = 'T'\n AND \t\t\ts.provider_id = " . Database::SqlInt($providerId); foreach ($this->db->getResultset($sql) as $row) { $categories[] = Database::GetInt($row['category_id']); } return $categories; }