Try:

<cfset session.user_ID = #CurrentUser.User_ID#>

<CFQUERY NAME="GetUsers" DATASOURCE="DSN">
SELECT User_ID, FullName, Login
FROM Users
WHERE User_ID = #session.user_ID#
ORDER BY Login
</CFQUERY>

And you'll probably need single quotes around #session.User_ID# if it's a
non-numeric field.

~~~~~~~~~~~~~~~~~~~~~~~~
Ricq Pattay <[EMAIL PROTECTED]>
Univ of MN College of Veterinary Medicine



----- Original Message -----
From: Jeremy Toevs <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, August 11, 2000 10:08 AM
Subject: CF Query Problem with Session Variables


Hey CF People,

I am storing the current users id in a session variable using the following:

<cfset session.user_ID = #CurrentUser.User_ID#>

Now I am trying to write a query that uses that.

<CFQUERY NAME="GetUsers" DATASOURCE="DSN">
SELECT User_ID, FullName, Login
FROM Users
WHERE session.user_ID = #CurrentUser.User_ID#
ORDER BY Login
</CFQUERY>

Is it possible to use it, or am I just writing it wrong?

Thanks in advance!

Jeremy

----------------------------------------------------------------------------
--
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=sts&body=sts/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.

Reply via email to