• I need to return only unique values of a query.
    Data is for people with professions. And I need to return a list of only the professions and I dont want them to be repeated. (only unique values)
    Right now I use this code and it works, but it repeats the professions associated to more than one person.
    I only need the array to return unique values of the field “WEB_tronc_commun”

    <?php
    $query = new AirpressQuery();
    $query->setConfig("SGF");
    $query->table("Professions");
    $query->view("Utilisation_active");
    $query->sort("WEB_tronc_commun");
    $events = new AirpressCollection($query);
    
    foreach($events as $e){
        echo '<a href="#' . $e["WEB_tronc_commun"] . '">' . $e["WEB_tronc_commun"] . " | ";
    }
    
    ?>
Viewing 1 replies (of 1 total)
  • Thread Starter sgervais71

    (@sgervais71)

    Here is the page where I use this :
    https://stephanegervais.com/repertoire-pcm/

    Just before the users cards with their info, I have an index with the professions.
    And right now, as you can see if I have more than one entry with the same profession, the profession repeats in the index (as you can see with “Coaching”)

    How can I modify the code so that it doesn’t repeat ?

    I love this plugin and I have the feeling that the colution is just around the corner.

Viewing 1 replies (of 1 total)
  • The topic ‘AirpressCollection unique values’ is closed to new replies.