I can't believe I can't figure this one out, I am passing an
id via the url variables using a hyper link. It comes back with an
error in my linked page saying there is an error in the way I used
a function. I don't get it, it's a function I use all the time.
Here is my queries that are passing and receiving the id.
indexpage:
<cfquery name="useRec"
datasource="#APPLICATION.dataSource#">
SELECT user.Fname AS ViewField1, user.email AS ViewField6,
user.Lname AS ViewField3, user.userName AS ViewField4,
user.password AS ViewField5, lastLogin, hits, user.ID AS ID
FROM user
</cfquery>
<cfoutput query="useRec">
<a href="page2.cfm?ID=#ID#" class="nav">View user
Record</a>
</cfoutput>
PAGE 2
<cfparam name="ID" type="integer" default="#url.ID#">
<cfquery name="useRec"
datasource="#APPLICATION.dataSource#">
SELECT user.Fname AS ViewField1, user.email AS ViewField6,
user.Mname AS ViewField2, user.Lname AS ViewField3, user.userName
AS ViewField4, user.password AS ViewField5, user.admin AS
ViewField6 user.lastLogin AS lastLogin, user.hits AS hits, user.ID
FROM user
<cfif isDefined("URL.ID")>
WHERE ID = <cfqueryparam value="#URL.ID#"
cfsqltype="cf_sql_integer">
</cfif>
</cfquery>
this is my error:
Error Executing Database Query. [Macromedia][SequeLink JDBC
Driver][ODBC Socket][Microsoft][ODBC Microsoft Access Driver] The
SELECT statement includes a reserved word or an argument name that
is misspelled or missing, or the punctuation is incorrect.
The error occurred on line 11.
It is throwing an error on my if statement. I have tried a
number of different options and still the same error.
Can anyone see what I might have missed?
Thank you.