Gilbert,

I'll try and explain a little more clearly.

Basically, yes you're right that the <cfoutput query=""> behaves as a loop.
Looping through each record obtained from the specified query - in your case
users.

Now, sometimes when we are looping an output it becomes necessary to have
some kind of control over the order in which it is output/processed. In your
own example this is not easily explained as it appears to simply be a syntax
requirement of nesting the cfmail tag, more than anything else. Most likely
to do with how the cfmail tag itself works.

However...

Going back to what I was saying about controlling the order of output. Lets
take a diary application as an example. We might have a table called
appointments, which will store each appointment as an individual lineitem,
with a primary key. Now there may be several appointments on a single day
(date field).

If we did a simple cfoutput on the query, we could get some semblance of
fluidity in the output, however it would be much nicer to group on the date
field, which would then give us nicely formatted output of a day by day
based diary.

I'm presuming that you are already aware of the above. Now, if we decided to
group the output by the primary key field, we're actually not going to be
affecting the final output one iota. Why? Because the original cfoutput on
the query is automatically 'grouping' by the primary key field anyway - by
the very nature and purpose of primary keys.

Maybe someone else might be able to explain all this in a more coherent
manner, but thats the basic logic behind it.

Dave

-----Original Message-----
From: Gilbert Midonnet [mailto:[EMAIL PROTECTED]]
Sent: 01 October 2002 15:24
To: CF-Talk
Subject: RE: embedding cfmail in a cfoutput -- thx


Dave,

It really doesn't make any sense but it works. I'm sure as I work with it
more it will sink in. Thx.

ummm ... Is this because <cfoutput query=""> loops through the table? ...
and this makes it stop at the first match?

// glm



-----Original Message-----
From: Dave Wilson [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, October 01, 2002 9:57 AM
To: CF-Talk
Subject: RE: embedding cfmail in a cfoutput


Do a group on the user id. This way your grouping is done on individual
unique values, hence cancelling out the grouping.

Hope this makes sense,
Dave

-----Original Message-----
From: Gilbert Midonnet [mailto:[EMAIL PROTECTED]]
Sent: 01 October 2002 14:54
To: CF-Talk
Subject: embedding cfmail in a cfoutput


I must be missing something very simple. I'm trying to embed a cfmail in a
cfoutput tag and am getting the following error msg.

// ERROR MSG

A CFMAIL tag is nested inside a CFOUTPUT tag that does not have a GROUP=
attribute. This is not allowed. Nesting these tags implies that you want to
use grouped processing. However, the top-level tag must specify a top-level
group using a GROUP= attribute.

// END of ERROR MSG

As I understand it I have no need of a group attribute; nor would the group
attribute help in this situation.  Of course it may be that my understanding
is incorrect. :-]


PROBLEM:

Users fill in a form. They are in a permissioned area. They authenticate
their submission by filling in their user username and password. (To be
doubly sure that the submitter is the person logged into the site.)

The processing page queries the database and sees if the username and
password equals the form submitted username and password. If it is a cfmail
is sent. If not then an error msg appears.

code below:

        <cfquery name="name" datasource="aaa">
                SELECT *
                FROM users
                WHERE Username='#log_username#'
        </cfquery>
        <cfoutput query="name">

                <cfif #username# EQ #form.submittedUsername# AND #password#
EQ #form.submittedPassword#>



                        <cfmail
                                to=""
                                from=""
                                subject=""
                        >


                                yadda yadda yadda


                        </cfmail>
                <cfelse>

                        Your username and password do not match the login
records of the current user.

                </cfif>

        </cfoutput>

thx,

gilbert midonnet







______________________________________________________________________
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to