The query you wrote does it. However, id the user is logging in with a username, isn't that username going to be in the DB somewhere? How is the authentication checked? What happens if two people have email addresses like f...@bleh.com and f...@whatever.org?
mxAjax / CFAjax docs and other useful articles: http://www.bifrost.com.au/blog/ 2009/3/20 Adam Parker <adgpa...@iupui.edu>: > > Hello - > > I have inherited a web application that is secured with a login. The user > logs in with a username, but the only way the user is uniquely identified in > the is by an email address. > > So if user George logs in with the username george123, how can I query the > database for the an email address that contains "george123?" > > Currently, I have > > <cfset user = #session.username#> > > <cfquery name="getUser" datasource="myDSN"> > SELECT firstname, lastname > FROM client > WHERE email like '%#user#%' > </cfquery> > > How may I compare the user variable to the email record in the database table? > > Thank you, > Adam > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/sql/message.cfm/messageid:3203 Subscription: http://www.houseoffusion.com/groups/sql/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.6