Somehow when running some queries in CF while using existing variables, there is no output showing up. These are the queries:
<cfquery name = "group" datasource = "#DSN#">
SELECT *
FROM groups
WHERE ownerid=#user.id#
ORDER by id
LIMIT 0, 30
</cfquery>
<cfquery name = "groups" datasource = "#DSN#">
SELECT *
FROM group_requests
WHERE groupid=#group.ownerid#
ORDER by groupid
LIMIT 0, 30
</cfquery>
<cfoutput query="groups">
#groupid#
</cfoutput>
As you can see first it gets the all the values from the #user.id# and afterwards it uses the value from the first query again in #groep.ownerid#. Somehow this won’t show any output value. And yes, there are values to be shown.
Kind regards,
I guess problem is that if 1st query returns multple records only first
group.owneridis used — which can give no matches, or much less than you are expecting.If results of the 1st query aren’t use elsewhere, I would suggest to have it all in the single query. Something like this:
Also I’m not sure if it makes sense to have two limits here, but there’s not enough information to make a meaningful suggestions.