Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

<cfparam name="url.id" question?

Explorer ,
Nov 23, 2011 Nov 23, 2011

My question: why am i able to see some items display and not others when the id of the url.id changes

I have a page listing items of which each item links to a master detail page of the single product. the master detail page will display on some items when clicked. howver the master detail page will not display on other item that are clicked. the master detail page has only one syntax structure so the only thing that changes is the url.id that is passed to it from my first page

(i.e.

THIS SHOWS THE CORRECT DISPLAY          http://localhost:8500/shotthp/Product_Order_page.cfm?proid=66

THIS SHOWS NOTHING                                http://localhost:8500/shotthp/Product_Order_page.cfm?proid=67

Please note also note the the database exist and has all of the information populated


<!---The link on the first page is below...--->

<a href="Product_Order_page.cfm?proid=#proid#" class="product_name">#product.proname#</a>

<!---Second page is below...--->

<cfparam name="URL.proid" default="1" type="Numeric">

<cfquery name="List_Discount" datasource="store">

SELECT *

FROM discount

</cfquery>

<cfset Percent=(#List_Discount.dispercentoff#*100)>

<cfquery name="product" datasource="store">

SELECT *

FROM product, catagory, subcatagory

WHERE product.proid = <cfqueryparam value="#URL.proid#" cfsqltype="cf_sql_numeric">

AND product.procatagoryid = catagory.catid

AND product.prosubcatid = subcatagory.subcatid

Group by product.proname

</cfquery>

<!---body--->

<body>

<img src="<cfoutput>#product.proimage#</cfoutput>" alt="" name="proimage" width="358" height="477" class="whiteBorder" />

  <cfoutput>

<div id="containercatalog">

<div id="containercatalogphotobox">

 

<img src="#product.proimage#" alt="" name="proimage" width="186" height="247" /><!---Content for  id "containercatalogphotobox" Goes Here---></div>

<div id="containercatalogcontent">

<div id="itemname_itemNo">

<span class="product_name">#product.proname#</span><br />

Item No: #product.proid#<br /><br />

<!---Top Lables--->

<span class="lable_product_name">Name</span><span class="price">Price</span> <span class="qty">Qty.</span><br />

<!---Content for  id "itemname_itemNo" Goes Here---></div><br />

<!---Item/Price/QTY No.1--->

<cfif #product.proprice# eq ""><span class="lable_product_name">Call For Pricing</span>

<cfelse><span class="lable_product_name">#product.proname# </span><span class="label_price">#DollarFormat(product.proprice)#</span>

</cfif>

<form action="Product_Order_page2.cfm" method="post">

<input name="proname" type="hidden" value="#product.proname#" />

<input name="price1" type="hidden" value="#product.proprice#" />

<select name="QTY1" class="box1" id="QTY1">

<option>1</option>

<option>2</option>

<option>3</option>

<option>4</option>

<option>5</option>

<option>6</option>

<option>7</option>

<option>8</option>

<option>9</option>

</select><br>

<br />

<!---Item/Price/QTY No.2--->

<cfif #product.proitem2# eq "" AND #product.proitem2price# lte "0"><input name="proitem2price" type="hidden" value="#product.proitem2price#" /><input name="qty2" type="hidden" value="0" /><cfelse>

<span class="lable_product_name">#product.proitem2#</span><input name="proitem2" type="hidden" value="#product.proitem2#" />

<span class="label_price">#DollarFormat(product.proitem2price)#</span><input name="proitem2price" type="hidden" value="#product.proitem2price#" />

<select name="QTY2" class="box1" id="QTY2">

<option>0</option>

<option>1</option>

<option>2</option>

<option>3</option>

<option>4</option>

<option>5</option>

<option>6</option>

<option>7</option>

<option>8</option>

<option>9</option>

</select><br>

<br /></cfif>

<!---Item/Price/QTY No.3--->

<cfif #product.proitem3# eq "" AND #product.proitem3price# lte "0"><input name="proitem3price" type="hidden" value="#product.proitem3price#" /><input name="qty3" type="hidden" value="0" /><cfelse>

  <span class="lable_product_name">#product.proitem3#</span><input name="proitem3" type="hidden" value="#product.proitem3#" />

  <span class="label_price">#DollarFormat(product.proitem3price)#</span><input name="proitem3price" type="hidden" value="#product.proitem3price#" />

<select name="QTY3" class="box1" id="QTY3">

<option>0</option>

<option>1</option>

<option>2</option>

<option>3</option>

<option>4</option>

<option>5</option>

<option>6</option>

<option>7</option>

<option>8</option>

<option>9</option>

</select><br>

<br /></cfif>

<!---Item/Price/QTY No.4--->

<cfif #product.proitem4# eq "" AND #product.proitem4price# lte "0"><input name="proitem4price" type="hidden" value="#product.proitem4price#" /><input name="qty4" type="hidden" value="0" /><cfelse>

  <span class="lable_product_name">#product.proitem4#</span>:<input name="proitem4" type="hidden" value="#product.proitem4#" />

  <span class="label_price">#DollarFormat(product.proitem4price)#</span>:<input name="proitem4price" type="hidden" value="#product.proitem4price#" />

<select name="QTY4" class="box1" id="QTY4">

<option>0</option>

<option>1</option>

<option>2</option>

<option>3</option>

<option>4</option>

<option>5</option>

<option>6</option>

<option>7</option>

<option>8</option>

<option>9</option>

</select><br>-------------------------<br /></cfif>

<input name="Next" type="submit" class="submit" value="Next" />

</div>

<!---Content for  id "containercatalog" Goes Here---></div>

</cfoutput>

<!---maincontentcontainer---></div>

<!---wrapper---></div>

<!---container---></div>

</form>

<cf_footer>

</div>

</body>

</html>

2.5K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Nov 23, 2011 Nov 23, 2011

Disclaimer I only skimmed the thread as that is too much code to wade through.

WHERE product.proid = <cfqueryparam value="#URL.proid#" cfsqltype="cf_sql_numeric">

AND product.procatagoryid = catagory.catid

AND product.prosubcatid = subcatagory.subcatid

When you are not seeing the expected output of a query, the first thing to do is cfdump the query object. If it is empty, it is most likely an issue with the query (or underlying data). Query the "product" table (only) for prodid=67. If that record is not found, the problem is your data. Otherwise, it is most likely a problem with your JOIN. 

INNER joins only pick up items that have matching records in all of the referenced tables. So in your case it would only return products that are assigned to a category AND have one or more subcategories.  If you want to include all products, regardless of whether they have matching categories/subcategories you need to use an OUTER join instead.

http://www.w3schools.com/SQl/sql_join.asp

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 23, 2011 Nov 23, 2011

Thanks for your help. The CFdump helped me to pinpoint an mis-types syntax. I really appreciate you assistance. Thanks again.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Nov 23, 2011 Nov 23, 2011

Yep, cfdump is a great debugging tool. Glad you figured things out.

 

-Leigh

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 30, 2011 Nov 30, 2011
LATEST

Looking at your ColdFusion code, I see that you are using # to dereference variables where you do not actually need to use the # mark.

<cfset Percent=(#List_Discount.dispercentoff#*100)>

You can actually rewrite this ColdFusion statement so that it is like the following:

<cfset Percent=(List_Discount.dispercentoff*100)>

This will work equally well, also the following are examples of not having to use the # characters with your string:

<!--- concatenate a string with a variable --->

<cfset MyPhone = "555-7777">

<cfset MyString = "My phone number is:" & MyPhone>

<!--- Or equivalently you can do the following with the same effect --->

<cfset MyPhone = "555-7777">

<cfset MyString = "My phone number is: #MyPhone#">

Michael G. Workman

mworkman@usbid.com

http://www.usbid.com

http://ic.locate-ic.com

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources