ColdFusion - How to get output of a query

cfoutput - get output of a query

cfoutputQuery.cfm


<!DOCTYPE html">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>cfoutput tag example: how to get output of a query in coldfusion</title>
</head>

<body>
<h2 style="color:Crimson">cfoutput Tag Example: Query</h2>

<cfquery name="qEmployee" datasource="cfdocexamples">
 SELECT Emp_ID, FirstName, LastName, Salary FROM EMPLOYEE
</cfquery>

<table bgcolor="CadetBlue" cellpadding="0" cellspacing="0">
 <tr bgcolor="DarkCyan">
     <td><b>Emp ID</b></td>
     <td><b>First Name</b></td>
     <td><b>Last Name</b></td>
     <td><b>Salary</b></td>
    </tr>
 <cfoutput query="qEmployee">
        <tr>
            <td>#Emp_ID#</td>
            <td>#FirstName#</td>
            <td>#LastName#</td>
            <td>#Salary#</td>
        </tr>
    </cfoutput>
</table>
</body>
</html>





More ColdFusion examples