Example:
<CFQUERY datasource="#DSN#" name="auth">
SELECT *
FROM PenPals
WHERE PP_Username = '#Form.PP_Username#'
</CFQUERY>
<CFIF auth.recordcount GT "0">
I'm sorry someone has already chosen that username, please go back
and choose another.
<CFELSE>
<CFINSERT dataSource="#dsn#" tableName="PenPals">
</CFIF>
Stay current with what's happening on AirportNet. Subscribe to our
Announcement list today: http://www.airportnet.org/email.htm
---------------------------------------
Kelly Matthews
Internet Development Coordinator
AAAE
703.578.2509
[EMAIL PROTECTED]
http://www.airportnet.org
---------------------------------------
> -----Original Message-----
> From: Jeremy Toevs [SMTP:[EMAIL PROTECTED]]
> Sent: Tuesday, August 29, 2000 12:02 PM
> To: [EMAIL PROTECTED]
> Subject: RE: UserAction.cfm
>
> How would that query look?
>
> >>> Kelly Matthews <[EMAIL PROTECTED]> 08/29/00 08:43AM >>>
> What i normally do is FIRST I RUN a QUERY against the database
> seeing if the USERNAME that was passed is equal to any username in the
> database. Then i do a <CFIF query.recordcount GT "1">
> and show a message that the username is taken and then a <CFELSE>
> that does the insert. That way if the query comes back with at least
> ONE record you know the user id is taken if it comes back with ZERO
> you do the insert.
> Kelly
>
> Stay current with what's happening on AirportNet. Subscribe to our
> Announcement list today: http://www.airportnet.org/email.htm
>
> ---------------------------------------
> Kelly Matthews
> Internet Development Coordinator
> AAAE
> 703.578.2509
> [EMAIL PROTECTED]
> http://www.airportnet.org
> ---------------------------------------
>
> > -----Original Message-----
> > From: Jeremy Toevs [SMTP:[EMAIL PROTECTED]]
> > Sent: Tuesday, August 29, 2000 11:49 AM
> > To: <
> > Subject: UserAction.cfm
> >
> > When you have a "No Duplicates" field in the database and a duplicate is
> > entered, CF returns somewhat of a weird error message. How do you get it
> > to return an error message saying "This UserName is already in use,
> choose
> > another." UserName being the "No Duplicates" field. Here is my action
> cfm:
> >
> > *********************************************************
> >
> > <cfquery datasource="DSN" name="AddUser">
> > INSERT INTO Users (UserName, RealName, Email)
> > VALUES ('#UserName#','#RealName#','#Email#')
> > </cfquery>
> >
> > *********************************************************
> >
> > Thanks in advance,
> >
> > Jeremy
> >
> >
> --------------------------------------------------------------------------
> > ----
> > Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
> > To Unsubscribe visit
> > http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk
> or
> > send a message to [EMAIL PROTECTED] with 'unsubscribe'
> in
> > the body.
> --------------------------------------------------------------------------
> ----
> Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
> To Unsubscribe visit
> http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
> send a message to [EMAIL PROTECTED] with 'unsubscribe' in
> the body.
>
> --------------------------------------------------------------------------
> ----
> Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
> To Unsubscribe visit
> http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
> send a message to [EMAIL PROTECTED] with 'unsubscribe' in
> the body.
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.