1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Using a <cfoutput> within a sql statement.

Discussion in 'Databases' started by minty_type-r, Jan 18, 2007.

  1. #1
    Hi,

    I'm trying to get the remote user name of the user and put it into my SQL query.

    My code is below but I'm not sure how to get my desired result.

    If you need some more infomation please let me know.

    Thanks in advance.

    Mark (Minty).

    <!---
    Name: submit2.cfm
    Author: Mark Oldham
    Description: Confirmation page, data submission and email process.

    Modifications:
    15/01/2007 : 08.07 : created base file.
    16/01/2007 : 11.48 : Email process enabled.
    17/01/2007 : 13.48 : Reference Number added to emails.
    --->

    <!--- Code to insert the form data into the requests01 table in the database. --->
    <
    CFINSERT
    DATASOURCE="revolution"
    TABLENAME="requests01"
    >
    <!--- Query to select the last record in the table requests01. --->
    <cfquery datasource="revolution" name="ccrefget">
    SELECT TOP 1 * FROM requests01 ORDER BY ccref DESC
    </cfquery>
    <!--- Query to select the email address of the current user from the users table. --->
    <cfquery datasource="revolution" name="getemail">
    SELECT email FROM users
    WHERE username='#CGI.REMOTE_USER#'
    </cfquery>
    <!--- <cfinclude template="mail.cfm"> --->

    <!--- Email confirmation process --->
    <cfmail server="164.38.196.141" from="noreply.revolution@dsgibusiness.com" to="authteam.revolution@dsgibusiness.com" cc="<cfoutput>#getemail.email#</cfoutput>" subject="New Change Request - CCREF: #ccrefget.CCREF# " >

    Change Control Reference: <cfoutput> #ccrefget.CCREF# </cfoutput>

    A new change request has been submitted by #CGI.REMOTE_USER#.

    If you have been asked to approve the request please use the link below and select Approve Request.

    http://revolution/

    Revolution Change Control System @ DSGi Business

    </cfmail>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Change Request Subbmission Complete</title>
    <style type="text/css">
    <!--
    .style1 {color: #000066}
    .style2 {color: #FF0000}
    .style3 {color: #000000; }
    -->
    </style>
    </head>

    <body>
    <h1 align="center" class="style1"><img src="../images/dsgilogo.gif" width="118" height="49" /></h1>
    <h1 align="center" class="style1">Revolution </h1>
    <h3 align="center" class="style2">Submission Complete</h3>
    <p align="center" class="style3">&nbsp;</p>
    <p align="center" class="style3">Your change re request has been submitted and you Reference Number is: <cfoutput> #ccrefget.CCREF# </cfoutput> </p>
    <p align="center" class="style3">&nbsp;</p>
    <p align="center" class="style3">You will shortly recieve an email with details of your request including the change control reference number for you records. </p>
    <p align="center" class="style2">&nbsp;</p>
    </body>
    <meta http-equiv="refresh" content="8;URL=../home.cfm" />
    </html>
     
    minty_type-r, Jan 18, 2007 IP
  2. minty_type-r

    minty_type-r Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    sorry I think I may have posted this in the wrong area.
     
    minty_type-r, Jan 18, 2007 IP