We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 27110
    • 2 Posts
    Hi,
    I’m having the following problem trying to build my first snippet: I made a page which queries the querystring and passes the values into a query, which works nicely, but not with special characters.

    This is a part of my code:
      $make = $modx->getOption('make',$scriptProperties);  
      $model = $modx->getOption('model',$scriptProperties);  
      if ((!empty($model)) && (!empty($make))) {  
        $query = $modx->newQuery('table_CarDetails');  
        $query->where(array('make' => $make, 'model' => $model));  
        $query->sortby('type','ASC');  
        $query->groupby('type');
        ...


    The table ’table_CarDetails’ contains records with make = ’Coupé’.
    But if $make gets the value ’Coupé’, no records return, but if the value for $make is ’Coupe’ I get results back from the table.

    I suppose I’m doing something not right but can not figure out what ... who can give me a push in the right direction?

    I’m using 2.0.4
      • 27110
      • 2 Posts
      Well, I haven’t figured out how to solve it. I have solved it by simply replacing the special characters. For now it are only two characters to replace. But you’ll all agree it is not a fancy solution.
      So solved for now but I’ll keep listening for any suggestion.