We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 895
    • 36 Posts
    Hi everyone!
    How to add a parameter WHERE(&where=`createdby = 1`) to getResources huh, such as
      $c = $modx->newQuery('modResource', array(
        'createdby' => $modx->user->get('id')
      ));
    


    Sorry for my English.
    • Try the following:

      <?php
      $c = $modx->newQuery('modResources');
      $c->where(array(
      	'createdby' => $modx->user->get('id'),
      ));
      $results = $modx->getCollection('modResource', $c);
      foreach($results as $result){
      	//your code...
      }