Re: searching multiple databases
This WebDNA talk-list message is from 1997
It keeps the original formatting.
numero = 14795
interpreted = N
texte = >Mabye i'm not understanding this correctly.>>I'm attempting to search another database using the [search] command in my>template based on the sku of a product selected on a previous page. If a>customer clicks on Shirt, I need to show on Detail.tmpl color options, I>had thought that building a colors.db and haveing fields sku and color,>hoping to search that db by that perticular sku selected and returning a>
menu with the perticular colors available to that item.>>I tried>[search db=colors.db&geSKUdata=[sku]]>[founditems][Color][/founditems]Okay, here are 3 things you need to correct:1- There's no [/search] after your founditems context.2- If you're searching for a matching sku, you have to useeqSKUdata=[sku], not geSKUdata=[sku].3- Simply putting [color] inside your founditems context will onlymake a list, it won't create a popup menu. Youy have to put your values inside the founditems context and the tagsoutside the founditems context in order to create a popup menu.I'm not sure how you're going to generate a unique SKU value when youhave only a single record in your products database. You can createunique SKU values by combining [cart]-generated SKU's with otherspecial codes for colors and sizes, is that what you're doing?The way I usually create products databases, every unique item hasits own record. This makes it easier to administer in the long run.If you sell ONE style of shirt in 5 different colors and 3 differentsizes, you should have 15 different records in your database -- onefor each combination of those 5 colors and 3 sizes.Then when someone does a search for that particular style of shirt(before he/she knows which color or size to choose from), your searchshould be a 'summary' search for the shirt style. A summary searchfor that style of shirt will retrieve only ONE of the 15 records inthe database.When your visitor gets the results of this search, it will show asingle style, and on that page you can then give your visitors thechoice of 5 colors and 3 sizes. When they make their color and sizeselections, a new search can be performed that retrieves the exactmatch record from the 15 possible matching records in your database.If you don't want to bother doing it that way, then you can put asingle record in your databases for the shirt's style, then storeyour color and size data in another database or two. But then youwill have to create SKU values on the fly ... not easy, but it works,and it keeps your main products database smaller, althiugh in mostcases, that's not really an issue.Sincerely, Ken GromeWebDNA Solutionshttp://www.smithmicro.com/webdnasolutions/.
Associated Messages, from the most recent to the oldest:
>Mabye i'm not understanding this correctly.>>I'm attempting to search another database using the [search] command in my>template based on the sku of a product selected on a previous page. If a>customer clicks on Shirt, I need to show on Detail.tmpl color options, I>had thought that building a colors.db and haveing fields sku and color,>hoping to search that db by that perticular sku selected and returning a> menu with the perticular colors available to that item.>>I tried>[search db=colors.db&geSKUdata=[sku]]>[founditems] [Color][/founditems]Okay, here are 3 things you need to correct:1- There's no [/search] after your founditems context.2- If you're searching for a matching sku, you have to useeqSKUdata=[sku], not geSKUdata=[sku].3- Simply putting [color] inside your founditems context will onlymake a list, it won't create a popup menu. Youy have to put your values inside the founditems context and the tagsoutside the founditems context in order to create a popup menu.I'm not sure how you're going to generate a unique SKU value when youhave only a single record in your products database. You can createunique SKU values by combining [cart] -generated SKU's with otherspecial codes for colors and sizes, is that what you're doing?The way I usually create products databases, every unique item hasits own record. This makes it easier to administer in the long run.If you sell ONE style of shirt in 5 different colors and 3 differentsizes, you should have 15 different records in your database -- onefor each combination of those 5 colors and 3 sizes.Then when someone does a search for that particular style of shirt(before he/she knows which color or size to choose from), your searchshould be a 'summary' search for the shirt style. A summary searchfor that style of shirt will retrieve only ONE of the 15 records inthe database.When your visitor gets the results of this search, it will show asingle style, and on that page you can then give your visitors thechoice of 5 colors and 3 sizes. When they make their color and sizeselections, a new search can be performed that retrieves the exactmatch record from the 15 possible matching records in your database.If you don't want to bother doing it that way, then you can put asingle record in your databases for the shirt's style, then storeyour color and size data in another database or two. But then youwill have to create SKU values on the fly ... not easy, but it works,and it keeps your main products database smaller, althiugh in mostcases, that's not really an issue.Sincerely, Ken GromeWebDNA Solutionshttp://www.smithmicro.com/webdnasolutions/.
Kenneth Grome
DOWNLOAD WEBDNA NOW!
Top Articles:
Talk List
The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...
Related Readings:
Re:Can anyone help me with this shipping thing? (1998)
Nested tags count question (1997)
Page authenticating when not supposed to (2003)
Any limit to [include] (1997)
[WebDNA] WebDNA 6.2 and Mac OS X 10.5 Client / Server ? (2009)
Sorting Numbers (1997)
submit order (twice) (2001)
[WebDNA] Windoes Server2008 users? (2011)
Separate SSL Server (1997)
Search returns all, not 20 (1997)
PCS Emailer's role ? (1997)
WebCat2b13 Command Reference Doc error (1997)
Queertrons? (1997)
Snake Bites (1997)
Re:E-Mailer (WebCatb15acgiMac) (1997)
emailer w/F2 (1997)
RE:math context ignores date prefs? (1998)
RE: NewCart+Search with one click ? (1997)
Error Lob.db records error message not name (1997)
Re[2]: Unix Webcat Permission - Suggestions (2000)