|
| |
|
|
64mustang
Posts: 4 Joined: 8/30/2004 Status: offline
|
DRW Help needed - 8/30/2004 20:51:42
I have a database which contains the following fields, ID Category (different product types) product_name (has multiple same names) design_number (a unique number for each product type and name) detail I have a category selection page that lists all product types listed in the database. When a category is selected, it takes you to a page that displays all of the products from the category selected. When a product is selected on this page, it takes you to a details page. All is working fine to this point. Now what I would like to do is create an additional DRW on the details page that will display items listed in the product name field that have the same product name (same name, different category). For example, category is "Floor Lamp" and product name is "Rachel". When the Rachel picture is selected, the details page has details about the Rachel Floor Lamp. I would like the details page to also display the other lamps in the Rachel product line, such as Table Lamps and Hanging Lamps (other category types). I have been unable to get the correct results and have no idea what to try next. Any help or suggestions will be greatly appreciated.
|
|
|
|
BeTheBall
Posts: 6355 Joined: 6/21/2002 From: West Point Utah USA Status: offline
|
RE: DRW Help needed - 8/30/2004 22:12:22
Welcome to OutFront. To do what you want, you first need to be sure that the Product Name is available outside the DRW that displays the details. Assuming you get to the details page via a hyperlink, include a parameter in that link for the product name. So, if your hyperlink is currently: details.asp?ID=<%=FP_FieldURL(fp_rs, "ID")%> change it to: details.asp?ID=<%=FP_FieldURL(fp_rs, "ID")%>&product_name=<%=FP_FieldURL(fp_rs, "product_name")%> Then the SQL to retrieve the other available categories would be something like: SELECT DISTINCT Category FROM tblName WHERE product_name = '::product_name::' The use of DISTINCT will prevent duplicates. Good luck.
_____________________________
Duane Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.
|
|
|
|
64mustang
Posts: 4 Joined: 8/30/2004 Status: offline
|
RE: DRW Help needed - 8/31/2004 15:20:16
Thanks Duane. That worked! Appreciate you help. Now you have my curiosity getting the best of me. So, now I do have a couple of additional questions. Is it possible to use "Like" instead of the "= " to return product_name that contains "Rachel"? Example "Rachel" and "Rachel square" The other question is. I see it is possible to retrieve the ID number for the category also. It is possible to use it to link to another detail page? Or am I going to far? Once again, thank you for all your help.
|
|
|
|
BeTheBall
Posts: 6355 Joined: 6/21/2002 From: West Point Utah USA Status: offline
|
RE: DRW Help needed - 8/31/2004 15:35:14
quote:
Now you have my curiosity getting the best of me. So, now I do have a couple of additional questions. Is it possible to use "Like" instead of the "= " to return product_name that contains "Rachel"? Example "Rachel" and "Rachel square" Yes. SELECT DISTINCT Category FROM tblName WHERE product_name LIKE '%::product_name::%' quote:
The other question is. I see it is possible to retrieve the ID number for the category also. It is possible to use it to link to another detail page? Or am I going to far? Don't see any reason you couldn't do that.
_____________________________
Duane Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.
|
|
|
|
64mustang
Posts: 4 Joined: 8/30/2004 Status: offline
|
RE: DRW Help needed - 8/31/2004 15:53:53
Thanks again! Could you give me some more insight on how you would go about retrieving the ID to use for the link. I can see the ID number by using <%=FP_FieldURL(fp_rs,"ID")%> in the DRW. But when I use details?ID=<%=FP_FieldURL(fp_rs, "ID")%> nothing happens. Thanks again you your help.
|
|
|
|
64mustang
Posts: 4 Joined: 8/30/2004 Status: offline
|
RE: DRW Help needed - 9/1/2004 7:41:13
Thanks Spooky and Duane for all your help. I think I now have everying working correctly.
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|