• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

CFLOOP CFQUERY CFOUTPUT CFMAIL Problem

Participant ,
May 13, 2007 May 13, 2007

Copy link to clipboard

Copied

I have a website which tracks ball leagues... So u can do a schedule online, etc...
I have a bug with my automatic email system which emails the team captains that they have a game that day...

Been farting around with alot of code - and can't quite get the cfmail working...
Code is attached, which has it currently pulling the correct data for leagues that have games and want to email the captains... But when I activate the cfmail tag... I get the errors... I have tried cfloop, grouping etc with no luck...

Any help is much appreciated...

TOPICS
Advanced techniques

Views

448

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 13, 2007 May 13, 2007

Copy link to clipboard

Copied

Step 1. Get all your data in one query by selecting from more than one table.

Step 2 - Use the query attribute of cfmail. Then you don't need any loops.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 13, 2007 May 13, 2007

Copy link to clipboard

Copied

I've tried UNION between 2 tables with no luck...
I also need to send an email to the home team and away team...
Needing to do other query's to sort out that...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 13, 2007 May 13, 2007

Copy link to clipboard

Copied

When I try this...
The data gets mixed up quite a bit...


<cfquery Name=try DATASOURCE="slopitch">
select * from schedule, league
WHERE GameDate = #todaydate# and emailcpt = 1
</cfquery>


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 13, 2007 May 13, 2007

Copy link to clipboard

Copied

quote:

Originally posted by: Merle_Hanson
When I try this...
The data gets mixed up quite a bit...

<cfquery Name=try DATASOURCE="slopitch">
select * from schedule, league
WHERE GameDate = #todaydate# and emailcpt = 1
</cfquery>


Add something like this

where some_field_from_schedule = some_field_from_league

Once you get your query giving you a good answer, you might need separate cfmail tags for the home and visiting captains, depending on whether or not you want to tell them different things.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 14, 2007 May 14, 2007

Copy link to clipboard

Copied

LATEST
Still got some hiccups...
Looks like it is sending it out multiple times...
Rather than just once...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation