Two parameters question
I have a database with around 1600 records as of now. I have several ways to search the db and thought i had all my bases covered. The problem is this. My employer has chosen to name several products the same name or (item number) but differing in that they are different brands or manufacturers. This poses a problem witht he way I have my search results set up obviously. When I search my db for say item number "BAB", I think I get 4 records with item# BAB returned. When I click on one of the items to view the details of the product, my code is assuming all BAB products are the same.
I need to know how to pass not only the item URL parameter, but the brandName URL parameter as well. I know how to pass URL parameters, but obviously I am doing something wrong because I cant get it to work correctly. Here is my query along with my output:
<cfparam name="URL.item" type="any" default="1">
<cfquery name="rsDetails" datasource="rlbulbs">
SELECT a.*, b.brandID, b.brandName
FROM rlbbulbs a, rlbbrand b
WHERE a.brandID = b.brandID
AND a.item = '#URL.item#'
</cfquery><h2>Bulb Details for Item #: <cfoutput><span class="yellowBG">#rsDetails.item#</span></cfoutput></h2>
<p><strong><em>Description:</em></strong> <cfoutput>#rsDetails.bulbDesc#</cfoutput></p>
<div id="detailTable"><cfoutput>
<table align="center">
<tr>
<td><cfif rsDetails.image1 NEQ "">
<a href="images/#rsDetails.image1#" target="_blank"><img src="images/#rsDetails.image1#" alt="#rsDetails.item#" title="#rsDetails.item#"/></a>
</cfif></td>
</tr>
</table>
</cfoutput>
<p> </p>
<table border="0" align="center" cellpadding="2" cellspacing="3">
<!--- <tr>
<th scope="row">Bulb ID</th>
<td><cfoutput>#rsDetails.bulbID#</cfoutput></td>
</tr> --->
<tr>
<th scope="row">Brand</th>
<td><cfoutput>#rsDetails.brandName#</cfoutput></td>
</tr>
<tr>
<th scope="row">Price</th>
<td><cfoutput>#dollarFormat(rsDetails.price)#</cfoutput> for <cfoutput>#rsDetails.qtyPerPrice#</cfoutput> unit/s</td>
</tr>
<tr>
<th scope="row">Wattage</th>
<td><cfoutput>#rsDetails.wattage#</cfoutput></td>
</tr>
<tr>
<th scope="row">Voltage</th>
<td><cfoutput>#rsDetails.voltage#</cfoutput></td>
</tr>
<tr>
<th scope="row">Base</th>
<td><cfoutput>#rsDetails.base#</cfoutput></td>
</tr>
<tr>
<th scope="row">Glass</th>
<td><cfoutput>#rsDetails.glass#</cfoutput></td>
</tr>
<tr>
<th scope="row">Filament</th>
<td><cfoutput>#rsDetails.filament#</cfoutput></td>
</tr>
<tr>
<th scope="row">Avg Life</th>
<td><cfoutput>#rsDetails.avgLife#</cfoutput> hours</td>
</tr>
<tr>
<th scope="row">Beam Angle</th>
<td><cfoutput>#rsDetails.beamAngle#</cfoutput></td>
</tr>
<tr>
<td colspan="2" align="center"><a href="../search.cfm">Search for another bulb</a></td>
</tr>
</table>
</div>
Thanks for any help in advance!
