>Hurry back before Dave notices you've actually posted something and turns
>the thread into a slugfest. ;-)
Doesn't matter, he'll notice! lol!
Ok, I removed the cftry. This sucker inserts TWO records into the db. If you
get back a recordcount from the search, it inserts a record with the correct
info, then ANOTHER record with an empty string for the criteria and 0 for the
recordcount. lol! This is actually kinda funny. If I remove the cfparam, it
correctly just inserts one record. KOO KOO....KOO KOO.... KOO KOO!
<cfparam name="FORM.criteria" default="">
<!--- Call the DAO for categories--->
<cfset prodcategories = APPLICATION.productDAO.getCategories()>
<!--- Call the DAO and get featured products --->
<cfset getfeaturedproducts = APPLICATION.productDAO.getfeaturedproducts()>
<!---Call the DAO to retrieve products by form criteria --->
<cfset getsearchproducts =
APPLICATION.productDAO.searchProducts(criteria=FORM.criteria)>
<!--- Insert this search into the database --->
<cfinvoke component="#APPLICATION.productDAO#" method="insertSearch"
criteria="#FORM.criteria#"
searchreturncount="#getsearchproducts.recordcount#">
Then in my cfc:
<cffunction name="insertSearch" access="public" output="false" hint="Adds
search to db">
<cfargument name="criteria" required="yes" type="string">
<cfargument name="searchreturncount" required="yes" type="numeric">
<cfset var insertsearch = "">
<cfquery datasource="#VARIABLES.dsn#" name="insertsearch">
INSERT INTO tblSearches (searchwords, searchdate, searchreturns)
VALUES (<cfqueryparam value="#ARGUMENTS.criteria#">,
<cfqueryparam cfsqltype="cf_sql_timestamp" value="#DateFormat(Now(),
"M/DD/YYYY")#">,
<cfqueryparam cfsqltype="cf_sql_smallint"
value="#ARGUMENTS.searchreturncount#">
)
</cfquery>
</cffunction>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking
application. Start tracking and documenting hours spent on a project or with a
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:226901
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54