We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36735
    • 18 Posts
    What would be the best/proper way to access mysql table views using the modx/xpdo?

      • 36735
      • 18 Posts
      I just tested this out and it worked fine.

      Any thoughts on whether or not this is a good or bad practice?

      $output = '';
      $sql = "SELECT * FROM v_my_custom_view";
      foreach ($modx->query($sql) as $row) {
          $output .= $row['field1'] .' - '.$row['field2'] .' <br/>';
      }
      return $output;