We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 14214
    • 299 Posts
    Tried using AjaxSearch and receive the following error:

    « MODx Parse Error »
    MODx encountered the following error while attempting to parse the requested resource:
    « Execution of a query to the database failed - 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 ’( DISTINCT CAST(ntv.id AS CHAR) SEPARATOR "," ) AS tv_id, GROUP »
    SQL: SELECT sc.id, sc.pagetitle, sc.longtitle, sc.description, sc.alias, sc.introtext, sc.menutitle, sc.content, sc.publishedon, GROUP_CONCAT( DISTINCT CAST(ntv.id AS CHAR) SEPARATOR "," ) AS tv_id, GROUP_CONCAT( DISTINCT ntv.value SEPARATOR ", " ) AS tv_value FROM `modx_site_content` sc LEFT JOIN( SELECT DISTINCT tv.id, tv.value, tv.contentid FROM `modx_site_tmplvar_contentvalues` tv WHERE (((tv.value LIKE ’%gas%’))) ) AS ntv ON sc.id = ntv.contentid WHERE ((sc.published=1) AND (sc.searchable=1) AND (sc.deleted=0) AND (sc.type=’document’) AND (sc.privateweb=0)) GROUP BY sc.id HAVING (((sc.pagetitle LIKE ’%gas%’) OR (sc.longtitle LIKE ’%gas%’) OR (sc.description LIKE ’%gas%’) OR (sc.alias LIKE ’%gas%’) OR (sc.introtext LIKE ’%gas%’) OR (sc.menutitle LIKE ’%gas%’) OR (sc.content LIKE ’%gas%’) OR (tv_value LIKE ’%gas%’))) ORDER BY sc.publishedon,sc.pagetitle


    Anyone have some ideas to help?
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Perhaps your version of MySQL does not support that kind of query?
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 5811
        • 1,717 Posts
          • 14214
          • 299 Posts
          I am running MySQL 4.0.25 and Apache 1.3.33 Any help or ideas? Still struggling. I went away from the search to address other issues but I am back and need to resolve.

          Thanks!
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            I believe that the GROUP_CONCAT function was not available in your version of MySQL.
            GROUP_CONCAT() was added in MySQL 4.1
            http://dev.mysql.com/doc/refman/4.1/en/group-by-functions.html#function_group-concat
              Studying MODX in the desert - http://sottwell.com
              Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
              Join the Slack Community - http://modx.org
              • 14214
              • 299 Posts
              Thank you for the info. I am not a MySQL expert by any means. If I were to update would the items built on 4.0 (I have a different site running off it) screw up or are the versions backward compatible?

                • 5811
                • 1,717 Posts
                To avoid the group concat with the tv_content try to add the parameter &whereSearch=`content` in your AS snippet call.
                  • 14214
                  • 299 Posts
                  I am performing a MySQL update on my server this evening and will see how it goes. Hopefully this solves things. Will keep you posted.
                    • 14214
                    • 299 Posts
                    Quote from: sottwell at May 13, 2009, 12:56 PM

                    I believe that the GROUP_CONCAT function was not available in your version of MySQL.
                    GROUP_CONCAT() was added in MySQL 4.1
                    http://dev.mysql.com/doc/refman/4.1/en/group-by-functions.html#function_group-concat

                    It was in fact the MySQL! Had my host do an upgrade last night and walah, the search works now! Thank you much for your help.
                      • 14214
                      • 299 Posts
                      Quick question, is there a way to use AjaxSearch to also look inside folders that contain PDF files?