cfqueryparam
Usingcfqueryparam.cfm
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>cfqueryparam- how to use cfqueryparam in cfquery tag</title>
</head>
<body>
<h2 style="color:DarkBlue; font-style:italic">ColdFusion cfqueryparam tag example: how to use cfqueryparam</h2>
<hr width="600" align="left" color="PowderBlue" />
<br />
<cfparam name="url.BookID" default="0">
<cfquery name="Books" datasource="cfbookclub">
select BookID, Title from Books
where BookID = <cfqueryparam value="#url.BookID#" cfsqltype="cf_sql_integer">
</cfquery>
<div style="font-family:'Courier New', Courier, monospace; font-size:large;">
<a href="Usingcfqueryparam.cfm?BookID=1">Book ID = 1</a> <br />
<a href="Usingcfqueryparam.cfm?BookID=2">Book ID = 2</a> <br />
<a href="Usingcfqueryparam.cfm?BookID=3">Book ID = 3</a> <br />
<a href="Usingcfqueryparam.cfm?BookID=4">Book ID = 4</a> <br />
</div>
<br />
<table border="0" cellpadding="2" cellspacing="2" bgcolor="OrangeRed" width="350">
<tr style="background-color:DeepPink; color:Snow; font-weight:bold;">
<td>
Book ID
</td>
<td>
Title
</td>
</tr>
<cfoutput query="Books">
<tr style="color:Snow; background-color:HotPink; font-family:'Courier New', Courier, monospace;">
<td>
#BookID#
</td>
<td>
#Title#
</td>
</tr>
</cfoutput>
</table>
</body>
</html>
- CFMAP - Generate an earth type google map in ColdFusion
- CFMAP - How to change google map marker color in ColdFusion
- How to use cfsqltype in cfqueryparam tag in ColdFusion
- How to cache query data in session scope in ColdFusion
- How to use NOT EQUAL operator in cfif condition in ColdFusion
- How to use NEQ operator in cfif condition in ColdFusion
- ColdFusion variables typeless feature
- ColdFusion number and date format mask
- ColdFusion dynamic variables
- How to determine whether a file exists in ColdFusion