Skip to main content
Participant
March 16, 2007
Question

CF - Mysql communication problem?

  • March 16, 2007
  • 1 reply
  • 400 views
I'm getting this error from a query that works fine when used directly with MySQL
But under CF it throws an error, and I suppose that is something that Cf is doing, because if I copy the SQL query thrown from the error , it still works fine.


==============

Error Executing Database Query.
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 b.id_article, group_concat( c.name order by c.use

The error occurred in D:\Hosting\flammen\myCFC\article2.cfc: line 5
Called from D:\Hosting\flammen\article\article2.cfm: line 5
Called from D:\Hosting\flammen\myCFC\article2.cfc: line 5
Called from D:\Hosting\flammen\article\article2.cfm: line 5

3 : <cffunction name="ListArticles" access="remote" returntype="query">
4 : <cfargument name="dsn" type="string" required="yes">
5 : <cfquery name="qListArticles" datasource="#dsn#">
6 : select a.id_article, a.title, u.users, t.tags
7 : from articles as a

SQL select a.id_article, a.title, u.users, t.tags from articles as a left outer join ( select b.id_article, group_concat( c.name order by c.user separator ', ') as users from articlexuser as b inner join users as c on c.id_user = b.id_user group by b.id_article ) as u on u.id_article = a.id_article left outer join ( select d.id_article, group_concat( e.tag order by e.tag separator ', ') as tags from articlextags as d inner join tags as e on e.id_tag = d.id_tag group by d.id_article ) as t on t.id_article = a.id_article
This topic has been closed for replies.

1 reply

Inspiring
April 25, 2007
add the argument before the </cffunction>

<return qListArticles>