Hi to all.. please help me with this school project for an e-commerce site that im doing ryt now..im a newbie in programming..
here's the scenario..
Im using coldfusion,ms access,dwcs3
How can I dynamically view the products that are base on dynamic category and subcategory?
using URL parameters
here is my table on my msaccess
tblcategory fieldname datatype category text subcategory text tblproduct ProductID text Subcategory text enter code here Description text
I already show dynamically the category and subcategory but I can't find a solution to show the products base on it's category and subcategory
here's my code
<cfparam name="URL.Category" default="1">
<cfquery name="rs_category" datasource="Database">
SELECT DISTINCT category
FROM tblcategory
</cfquery>
<cfquery name="rs_subcategory" datasource="Database">
<cfif category eq 1>
SELECT *
FROM tblcategory
<cfelse>
SELECT *
FROM tblcategory
WHERE Category = <cfqueryparam value="#URL.Category#" cfsqltype="cf_sql_clob" maxlength="50">
</cfif>
</cfquery>
<body>
<cfoutput query="rs_category"><a href="dynamic.cfm?category=#rs_category.category#">#rs_category.category#</a><br />
</cfoutput>
<br />
<cfoutput query="rs_subcategory">#rs_subcategory.Subcategory#<br />
</cfoutput>
<br />
</body>
</html>
sample output
category(dynamic category) Electrical (when click show electrical subcategory) Steel Wood subcategory(base on the category dynamically show the subcategory) Phelps dodge Metro Wire
Wire Spool
( I need to show the products that are under the same category and subcategory dynamically)
(This is the part that I need to know... so can someone who has experience in cf can help me..)