
« 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 ’SELECT sc.id, sc.pagetitle, sc.longtitle, sc.description, sc.al »
SQL: SELECT cnt.id, cnt.publishedon, cnt.pagetitle, cnt.longtitle, cnt.description, cnt.alias, cnt.introtext, cnt.menutitle, cnt.content, cnt.tv_content, cnt.tv_id FROM (SELECT sc.id, sc.pagetitle, sc.longtitle, sc.description, sc.alias, sc.introtext, sc.menutitle, sc.content, sc.publishedon, GROUP_CONCAT( DISTINCT tv.value ORDER BY tv.value SEPARATOR ", " ) AS tv_content, GROUP_CONCAT( DISTINCT CAST(tv.id AS CHAR) SEPARATOR "," ) AS tv_id FROM `legalaid`.`legal_site_content` sc LEFT JOIN `legalaid`.`legal_site_tmplvar_contentvalues` tv ON sc.id = tv.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) AS cnt WHERE (cnt.pagetitle LIKE ’%director%’ OR cnt.longtitle LIKE ’%director%’ OR cnt.description LIKE ’%director%’ OR cnt.alias LIKE ’%director%’ OR cnt.introtext LIKE ’%director%’ OR cnt.menutitle LIKE ’%director%’ OR cnt.content LIKE ’%director%’ OR cnt.tv_content LIKE ’%director%’) ORDER BY publishedon, pagetitle
Starting with MySQL 4.1, all subquery forms and operations that the SQL standard requires are supported, as well as a few features that are MySQL-specific.http://dev.mysql.com/doc/refman/4.1/en/subqueries.html
With MySQL versions prior to 4.1, it was necessary to work around or avoid the use of subqueries. In many cases, subqueries can successfully be rewritten using joins and other methods. See Section 12.2.8.11, “Rewriting Subqueries as Joins for Earlier MySQL Versions”.
Version de MODx 0.9.6.2 Nom de code de version rev 4077 ... Nom du serveur de la BDD localhost
mysql MySQL Support enabled Active Persistent Links 3 Active Links 4 Client API version 4.1.22 MYSQL_MODULE_TYPE external MYSQL_SOCKET /var/lib/mysql/mysql.sock MYSQL_INCLUDE -I/usr/include/mysql MYSQL_LIBS -L/usr/lib/mysql -lmysqlclient
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 near 'SELECT sc.id, sc.pagetitle, sc.longtitle, sc.description, sc.alias, sc.introtext' at line 1 » SQL: SELECT cnt.id, cnt.publishedon, cnt.pagetitle, cnt.longtitle, cnt.description, cnt.alias, cnt.introtext, cnt.menutitle, cnt.content, cnt.tv_content, cnt.tv_id FROM (SELECT sc.id, sc.pagetitle, sc.longtitle, sc.description, sc.alias, sc.introtext, sc.menutitle, sc.content, sc.publishedon, GROUP_CONCAT( DISTINCT tv.value ORDER BY tv.value SEPARATOR ", " ) AS tv_content, GROUP_CONCAT( DISTINCT CAST(tv.id AS CHAR) SEPARATOR "," ) AS tv_id FROM `0680013V_modx`.`modx_site_content` sc LEFT JOIN `0680013V_modx`.`modx_site_tmplvar_contentvalues` tv ON sc.id = tv.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) AS cnt WHERE (cnt.pagetitle LIKE '%prout%' OR cnt.longtitle LIKE '%prout%' OR cnt.description LIKE '%prout%' OR cnt.alias LIKE '%prout%' OR cnt.introtext LIKE '%prout%' OR cnt.menutitle LIKE '%prout%' OR cnt.content LIKE '%prout%' OR cnt.tv_content LIKE '%prout%') ORDER BY publishedon, pagetitle
echo mysql_get_server_info();
MySQL - 4.0.18-nt-log, Protocol version: 10As said by Sottwell, AjaxSearch (which uses sub select sql statements) needs MySql version >=4.1.
<script type="text/javascript" src="assets/snippets/ajaxSearch/js/ajaxSearch.js"></script> <!-- start AjaxSearch header --> <script type="text/javascript"> config = 'default'; as_version = '1.8.0'; debug = 0; as_language = 'francais-utf8'; opacity = 1; advSearch = 'oneword'; whereSearch = 'content,tv'; order = 'publishedon,pagetitle'; rank = 'pagetitle:100,extract'; minChars = 3; ajaxMax = 6; showMoreResults = 1; moreResultsPage = 17; extract = '1:content,description,introtext,tv_content'; extractLength = 200; extractEllips = '...'; extractSeparator = '<br />'; formatDate = 'd/m/y : H:i:s'; liveSearch = 0; docgrp = ''; listIDs = ''; idType = 'parents'; depth = 10; highlightResult = 1; hideMenu = 2; hideLink = 1; as_filter = ''; tplAjaxResult = ''; tplAjaxResults = ''; stripInput = 'defaultStripInput'; stripOutput = 'defaultStripOutput'; breadcrumbs = '0'; tvPhx = '0'; </script> <!-- end AjaxSearch header -->
<script type="text/javascript" src="manager/media/script/mootools/mootools.js"></script>