I have not used CF in some time and I am trying to create some simple queries to pull data based on a value the user selects on a form.
Can someone tell me why the first query below works, but does not work when I add a where clause... My eyes must be going bad.
This works:
<cfquery name="totallist2" datasource="alist">
SELECT *
FROM store_info
ORDER BY store_name
</cfquery>
<cfoutput>
#form.state#<br>
</cfoutput>
<cfoutput query="totallist2">
#store_name# <br>
</cfoutput>
This query does not work. the only difference is the where parameter.
<cfquery name="totallist2" datasource="alist">
SELECT *
FROM store_info where state = #form.state#
ORDER BY store_name
</cfquery>
<cfoutput>
#form.state#<br>
</cfoutput>
<cfoutput query="totallist2">
#store_name# <br>
</cfoutput>
Can someone tell me why the first query below works, but does not work when I add a where clause... My eyes must be going bad.
This works:
<cfquery name="totallist2" datasource="alist">
SELECT *
FROM store_info
ORDER BY store_name
</cfquery>
<cfoutput>
#form.state#<br>
</cfoutput>
<cfoutput query="totallist2">
#store_name# <br>
</cfoutput>
This query does not work. the only difference is the where parameter.
<cfquery name="totallist2" datasource="alist">
SELECT *
FROM store_info where state = #form.state#
ORDER BY store_name
</cfquery>
<cfoutput>
#form.state#<br>
</cfoutput>
<cfoutput query="totallist2">
#store_name# <br>
</cfoutput>