cfqueryparam- how to use cfqueryparam in cfquery tag



<!DOCTYPE html>
<html xmlns="">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>cfqueryparam- how to use cfqueryparam in cfquery tag</title>

<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">

<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 />
<br />

<table border="0" cellpadding="2" cellspacing="2" bgcolor="OrangeRed" width="350">
 <tr style="background-color:DeepPink; color:Snow; font-weight:bold;">
   Book ID        
 <cfoutput query="Books">
        <tr style="color:Snow; background-color:HotPink; font-family:'Courier New', Courier, monospace;">