Jamie Price wrote:
>>
>> SELECT   o.UserID, GROUP_CONCAT(o.CardID)
>> FROM     mycards t INNER JOIN mycards o ON t.cardid = o.cardid
>> WHERE    t.trade = 1
>>          AND
>>          o.own = 1
>>          AND
>>          t.UserID = <cfqueryparam value="#cUserID#" 
>> cfsqltype="cf_sql_integer">
>> GROUP BY o.UserID
> 
> I tried replacing my 2nd query with that code (the qGetMatches query) and got 
> the following error:
> 
> Error Executing Database Query.  
> Syntax error or access violation: 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 &apos;(o.CardID) FROM mycards t INNER JOIN mycards o ON t.  

>  Keep in mind I'm using MySQL v4.0.18 as my database solution - would your 
> code be compatible with that?

Apparently not. You will have to do the grouping in your cfoutput:

SELECT   o.UserID, o.CardID
FROM     mycards t INNER JOIN mycards o ON t.cardid = o.cardid
WHERE    t.trade = 1
          AND
          o.own = 1
          AND
          t.UserID = <cfqueryparam value="#cUserID#" 
cfsqltype="cf_sql_integer">
ORDER BY o.UserID

<cfoutput group="UserID" ...>
     #UserID#
     <cfoutput>
         #CardID#
     </cfoutput>
</cfoutput>

Jochem


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Special thanks to the CF Community Suite Silver Sponsor - RUWebby
http://www.ruwebby.com

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:187732
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to