Hi,
I feel a bit stupid asking this, but I just can't work it out. Whenever I
want to do some complicated SQL, I usually end up needing to run lots of
queries, inside other cfoutputs and queries, but none of them ever work.
My latest scenario is this; as part of a scheduled task, I need to take each
member's email address and `preferences` from the members' table, and query
another table based on that. Something like this:
<cfquery name="getmembers" datasource="six">
SELECT * FROM members
</cfquery>
<cfoutput query="getmembers">
<cfquery name="getdetails" datasource="six">
SELECT * FROM details WHERE main_body like '%#pref1#%'
</cfoutput>
If any results are returned from `getdetails,` I want to mail them to that
person's email address defined in `getmembers.` And do that for every
member in the Members table. Incidentally, in each member profile there are
3 "prefs" (pref1,2,3)
It seems basic, but I just can't fathom what I need to do.
Thanks
Will
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists