How would one go about passing one database variable to another? Here's my
dilemma; 

I have been asked to write a counter that will store the users ID in the
table (in addition to IP/page/browser etc). Once the user is authenticated I
would like to pass the users ID into my counter table. The problem is that
it is not allowing me to do this. I have two separate Data Sources
established 1) Temp (a.k.a counter) 2) login (a.k.a. the permission
validation).

For reference, here is my code:

-counter.cfm-

<cfquery datasource="temp">
  Insert into Tracking(  
  <cfif #CGI.path_translated# is not "">
    RequestedFile,
  </cfif>
  <cfif #CGI.remote_host# is not "">
    UserIP,
  </cfif>
  <cfif #CGI.HTTP_USER_AGENT# is not "">
    ClientBrowser,
  </cfif>
  date_in,time_in,requestid)
  
  
  Values(
  <cfif #CGI.path_translated# is not "">
    '#CGI.path_translated#',
  </cfif>
  <cfif #CGI.remote_host# is not "">
    '#CGI.remote_host#',
  </cfif>
  <cfif #CGI.HTTP_USER_AGENT# is not "">
    '#CGI.HTTP_USER_AGENT#',
  </cfif>
  #date_in#,#time_in#,#requestid#)
</cfquery>

-login.cfm-
<cfquery name="getpermission" datasource="login">
        select
                permissions
        from
                thepermissions
        where
                id ='#requestid#'
</cfquery>

</snip>

Any help would be most appreciative!

TIA,
Dayv

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to