We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 34544
    • 1 Posts
    Hello,

    I’m new here and quite new to using MODx revo. Here is the problem I’m having:
    I’m trying to do a BETWEEN query, eg:

    $collection = $modx->newQuery(’Box’);
    $collection->andCondition(array(’price:BETWEEN’, array(100,500)));

    But this is not working. I’m pretty sure the syntax is not right but I couldn’t find a sample usage.

    Thanks,
    Alex.
      • 33968
      • 863 Posts
      How about this instead:
      $collection = $modx->newQuery('Box');
      $collection->where(array('price:>' => 100));
      $collection->andCondition(array('price:<' => 500));
      


      I’m not sure if BETWEEN is a valid operator, see here: http://rtfm.modx.com/display/xPDO20/xPDOQuery