We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 27519
    • 275 Posts
    You can debug your query with:

    $modx->log(modX::LOG_LEVEL_ERROR, $c->toSql());
    


    This will show the generated SQL statement in the MODx error log in the manager.

    Take it from there to see whether your query runs as expected in PHPMYADMIN or equivalent.
      MODx Revolution / MAMP / OS X
      • 29661
      • 116 Posts
      I fixed my sql problem with this code:
      $c = $modx->newQuery('Indication'); 
      $c->bindGraph('{"IndicationType":{}}');
      
      $c->sortby($sort,$dir); 
      
      $indications = $modx->getCollectionGraph('Indication', '{"IndicationType":{}}', $c);


      Hope it is fast enought and don’t slow my web...
        --
        John
        @theboxer