Re: How to best sort in a pre-defined item-by-item order ...

This WebDNA talk-list message is from

2003


It keeps the original formatting.
numero = 49725
interpreted = N
texte = How do you plan to have the visitor specify this order? Have you gotten that far yet?I once created a My Shopping List feature for an online grocer. The visitor was able to create various shopping lists, such as Camping, Bathroom, Picnic, etc. Of course the visitor had to Become A Member in order to use this feature, which gave him/her a unique member ID.The way I approached that situation was to create a shoppinglists.db where each shopping list was recorded with the member ID, name of list, sku, item, price, last purchased, etc. As the visitor accessed his Shopping Lists, of course there was a default sort, but then he could select from various the sort orders.Unfortunately, I can't say much about performance. The project was closed because the client didn't want to pay up. ho hum But my theory in this approach was that it would be less stress for WebDNA to do one search by recording the basic item information rather than forcing multiple searches to pull the item information from the main item database.Just my take. -----Original Message----- From: WebDNA Talk [mailto:WebDNA-Talk@talk.smithmicro.com] On Behalf Of Kenneth Grome Sent: Wednesday, April 23, 2003 10:29 AM To: WebDNA Talk Subject: How to best sort in a pre-defined item-by-item order ...I have two db's, a visitors.db and a products.db.I want to keep a list of a visitor's favorite products in the favorites field in his visitors.db record. My plan is to make this a comma-delimited list, and to store the sku of each favorite item in this field. But I do not want these skus stored randomly. Instead, I want them stored in the same order that the visitor wants to see them displayed when he clicks a link to View My Favorite Products.It's easy enough to store a bunch of comma-separated skus in the favorites field in a database record. And it's even easy to get WebDNA to store these skus in the specific order the visitor wants to see them when he views them in his browser. But ...If I'm going to perform a search in the products.db for the specific skus that appear in the favorites field of a visitors.db record, how do I make WebDNA sort the founditems in the order that the skus appear in my search parameters?Is this a case where I have to create a separate database, or a temporary database, just to get the founditems to appear in the specific item-by-item order I need?Or would a listwords loop with a bunch of lookups (or exact-match searches) be a better way to force the display into the proper order?Basically I'm looking for some theoretical (and hopefully some informed technical) answers to this problem -- answers that consider the relative performance hits of each proposed technique -- so I can select the technique that will produce fast results with the smallest performance hit to the WebDNA engine.I can see now that occasionally, such as in this situation, it would be really cool to be able to sort the founditems based on the order of the values as they appear in the search parameters. How hard would this be to add as a feature to WebDNA?I'm imagining a new set of parameter such as sortOrder=12,34,51,19,63,11,49&sortField=SKU ... which would tell WebDNA to sort the results in the order that the 'sortOrder' values appear when each of those comma-separated values is found in the 'SKU' field ... -- Sincerely, Kenneth Grome---------------------------------------------- Wholesale WebDNA programming only $27 an hour! ----------------------------------------------------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: How to best sort in a pre-defined item-by-item order ... (Kenneth Grome 2003)
  2. Re: How to best sort in a pre-defined item-by-item order ... (Alex McCombie 2003)
  3. Re: How to best sort in a pre-defined item-by-item order ... (John Peacock 2003)
  4. Re: How to best sort in a pre-defined item-by-item order ... (Alex McCombie 2003)
  5. Re: How to best sort in a pre-defined item-by-item order ... (John Peacock 2003)
  6. Re: How to best sort in a pre-defined item-by-item order ... (Alex McCombie 2003)
  7. Re: How to best sort in a pre-defined item-by-item order ... (Kenneth Grome 2003)
  8. Re: How to best sort in a pre-defined item-by-item order ... (Kenneth Grome 2003)
  9. Re: How to best sort in a pre-defined item-by-item order ... (Tim Robinson 2003)
  10. Re: How to best sort in a pre-defined item-by-item order ... (Kimberly D. Walls 2003)
  11. Re: How to best sort in a pre-defined item-by-item order ... (John Peacock 2003)
  12. How to best sort in a pre-defined item-by-item order ... (Kenneth Grome 2003)
How do you plan to have the visitor specify this order? Have you gotten that far yet?I once created a My Shopping List feature for an online grocer. The visitor was able to create various shopping lists, such as Camping, Bathroom, Picnic, etc. Of course the visitor had to Become A Member in order to use this feature, which gave him/her a unique member ID.The way I approached that situation was to create a shoppinglists.db where each shopping list was recorded with the member ID, name of list, sku, item, price, last purchased, etc. As the visitor accessed his Shopping Lists, of course there was a default sort, but then he could select from various the sort orders.Unfortunately, I can't say much about performance. The project was closed because the client didn't want to pay up. ho hum But my theory in this approach was that it would be less stress for WebDNA to do one search by recording the basic item information rather than forcing multiple searches to pull the item information from the main item database.Just my take. -----Original Message----- From: WebDNA Talk [mailto:WebDNA-Talk@talk.smithmicro.com] On Behalf Of Kenneth Grome Sent: Wednesday, April 23, 2003 10:29 AM To: WebDNA Talk Subject: How to best sort in a pre-defined item-by-item order ...I have two db's, a visitors.db and a products.db.I want to keep a list of a visitor's favorite products in the favorites field in his visitors.db record. My plan is to make this a comma-delimited list, and to store the sku of each favorite item in this field. But I do not want these skus stored randomly. Instead, I want them stored in the same order that the visitor wants to see them displayed when he clicks a link to View My Favorite Products.It's easy enough to store a bunch of comma-separated skus in the favorites field in a database record. And it's even easy to get WebDNA to store these skus in the specific order the visitor wants to see them when he views them in his browser. But ...If I'm going to perform a search in the products.db for the specific skus that appear in the favorites field of a visitors.db record, how do I make WebDNA sort the founditems in the order that the skus appear in my search parameters?Is this a case where I have to create a separate database, or a temporary database, just to get the founditems to appear in the specific item-by-item order I need?Or would a listwords loop with a bunch of lookups (or exact-match searches) be a better way to force the display into the proper order?Basically I'm looking for some theoretical (and hopefully some informed technical) answers to this problem -- answers that consider the relative performance hits of each proposed technique -- so I can select the technique that will produce fast results with the smallest performance hit to the WebDNA engine.I can see now that occasionally, such as in this situation, it would be really cool to be able to sort the founditems based on the order of the values as they appear in the search parameters. How hard would this be to add as a feature to WebDNA?I'm imagining a new set of parameter such as sortOrder=12,34,51,19,63,11,49&sortField=SKU ... which would tell WebDNA to sort the results in the order that the 'sortOrder' values appear when each of those comma-separated values is found in the 'SKU' field ... -- Sincerely, Kenneth Grome---------------------------------------------- Wholesale WebDNA programming only $27 an hour! ----------------------------------------------------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ Kimberly D. Walls

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:

Sorting by date (1997) [table] strange behaviour REAL solution (2003) Cookie still not working (1999) Image maps/Webcat (1997) Frames and WebCat (1997) WebCat2b13MacPlugIn - [showif][search][/showif] (1997) Expire Cookie in 8 Hours (2004) Quotation Marks in Database (1998) greater than or equal to (1997) EIMS Problems (1997) unable to launch acgi in WebCat (1997) Another issue with [Date format] (1998) Help! WebCat2 bug (1997) OPEN MARKET PATENTS SOUND ECOMMERCE ALARM (1998) Almost a there but..bye bye NetCloak (1997) incrementing a counter remotely? (1999) Execute Applescript (1997) Netscape v. IE (1997) Orderfile Info is Dissappearing (1998) Purchase Plugin Missing (1996)