Skip navigation
Merle_Hanson
Currently Being Moderated

CFLOOP CFQUERY CFOUTPUT CFMAIL Problem

May 13, 2007 12:48 PM

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...

 
Replies
  • Currently Being Moderated
    May 13, 2007 2:52 PM   in reply to Merle_Hanson
    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.
     
    |
    Mark as:
  • Currently Being Moderated
    May 13, 2007 5:20 PM   in reply to Merle_Hanson
    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.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points