We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 40541
    • 85 Posts
    Apologies if this is a simple one but have tried as many variations as I can think of but can get this to work.

    What I trying to do is simply run the query

    SELECT * 
    FROM  `DestinationNames` 
    WHERE number LIKE  '019%'
    


    Where the 019 is going to be a session varable.

    My query curretnly looks like this

    $c = $modx->myDB->newQuery('DestinationNames');
    $c->where(array('Number:LIKE' => $_SESSION['searchResult']));
    


    Which works fine, but I don't know how to introduce the percentage?

    Thanks in advance.

    This question has been answered by opengeek. See the first response.

    • discuss.answer
      • 22303 MODX Staff
      • 10,725 Posts
      $c = $modx->myDB->newQuery('DestinationNames');
      $c->where(array('Number:LIKE' => $_SESSION['searchResult'] . '%'));
      
        • 40541
        • 85 Posts
        Much appreciated opengeek.