We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36718
    • 3 Posts
    i want to make order by snippet
    [[!getResourcesTag?
      &element=`getResources`
      &elementClass=`modSnippet`
      &tpl=`siteCatalog`
      &hideContainers=`1`
      &pageVarKey=`page`
      &parents=`[[*id]]`
      &includeTVs=`1`
      &includeContent=`1`
      &sortby=`FIELD([[!starRatingOrder? &starId=`modResource.id`]])`
    ]]


    but it is not work
    (ERROR @ /index.php) Error 42000 executing statement: 
    Array
    (
        [0] => 42000
        [1] => 1064
        [2] => You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') DESC LIMIT 10' at line 1


    the snippet returns integer value(0-100)

    any ideas?
      • 22303 MODX Staff
      • 10,725 Posts
      The MySQL FIELD() function requires a field name and the primary keys of the records in the order you want them to appear. I don't believe that's what you want.