Thanks guys. I've used a combination of your help to come up with the
following code, which works (to an extent):
<cfquery name="CheckUser" datasource=#ds#>
SELECT messages.mID, messages.to_email, members.email, members.password
FROM messages, members
WHERE messages.mID = #form.ID# AND members.password = '#form.password#' AND
members.email = '#form.email#' AND messages.to_email = '#form.email#'
</cfquery>
I'm over-complicating what I actually have to do (It's an "anonymous"
messaging system, to hide email addresses, inserts message into Database).
Thanks for all your help.
Will
----- Original Message -----
From: "W Luke" <[EMAIL PROTECTED]>
Newsgroups: cf-talk
Sent: Friday, September 29, 2000 10:07 PM
Subject: Query Advise
> Hi,
>
> For me, SQL is either thoroughly straightforward, or bizarrely confusing.
> As soon as I try to do something remotely complicated, I run into trouble,
> simply cannot work it out, and come to you guys. As well as advising me
how
> to fix my latest Query - can anyone tell me of a decent SQL website for
> advanced queries, or a book? I'd be really grateful.
>
> OK the query in question is as follows:
>
> <cfquery name="checkuser" datasource=#ds#>
> SELECT mID,from_email,email,password FROM messages,members WHERE
> messages.mID = #form.ID# AND messages.from_email = '#form.email#' AND
> members.password = '#form.password#' AND members.email = '#form.email#'
> </cfquery>
>
> mID and from_email are fields in the "messages" table. Password and email
> are fields in the members Table. mID is originally set from a url
variable,
> and for example might be set to 5. This would return an email address
> 'from_email' - what I need to do is validate this email against one stored
> in members, check the pass, and if all is OK then move on.
>
> I've spent the whole day on this, on and off, and still it's saying "wrong
> password"!
>
> Advise much appreciated..
>
> Cheers
>
> Will
>
> --------------------------------------------------------------------------
----
> Archives: http://www.mail-archive.com/[email protected]/
> 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/[email protected]/
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.