We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 29332
    • 80 Posts
    I’m sorry if this is posted elsewhere, but I’ve just spent an hour looking. I’m trying to make a page that displays all users that signed up for my site. How do I do that? Is there a simple snippit call that I don’t know about?
    Thanks
      Teaching myself MODx
      • 32725
      • 107 Posts
      Try something like this

      <?php
      $output = '';
      
      $table_users = $modx->getFullTableName('web_users');
      $users = $modx->db->select('`username`', $table_web_users);
      foreach ($users as $user) {
          $output .= $user['username'] . '<br>';
      }
      
      return $output;
      ?>
      
        My portfolio
        Самурай без меча подобен самураю с мечом, только без меча.
        • 26931
        • 2,314 Posts
        just checked...this works for me:
        <?php
        $output = '';
        $tableusr = $modx->getFullTablename('web_users');
        $fieldusr = 'username';
        $usr = $modx->db->select($fieldusr, $tableusr);
        $users = $modx->db->makeArray($usr); 
        foreach ($users as $user) {
            $output .= $user['username'] . '<br />';
        }
        return $output;
        ?>