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 = 49724
interpreted = N
texte = Kenneth Grome wrote: > It's easy enough to store a bunch of comma-separated skus in the > favorites field in a database record. This is another instance of not using the tool to it's full potential. I have never seen a single instance of someone wanting to store multiple values in a single field that wasn't more efficiently done using multiple rows in a database instead.Create a new database favorites.db with the following columns:useridhitsSKUwhere [userid] is whatever you have as the unique identifier for the user in your visitors.db.However you want to add the items to the favorites.db initiall, set the [hits] field to 1. As they chose that same link more than once, increment the [hits] column each time. You may want to ensure that they don't have more than X number of favorites (I would suggest 10 or so as the max); you will need to create logic to replace the last record with the new item if they already have the maximum number of favorites listed.Then, when you want to display their favorites list, do a search with reverse sorting on the [hits] column and within the [founditems] loop, do a [lookup] or [search] of the products database for that item's info. This scheme will autosort their favorites in decreasing order of how favored the items it.QEDJohn-- John Peacock Director of Information Research and Technology Rowman & Littlefield Publishing Group 4501 Forbes Boulevard Suite H Lanham, MD 20706 301-459-3366 x.5010 fax 301-429-5748 ------------------------------------------------------------- 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)
Kenneth Grome wrote: > It's easy enough to store a bunch of comma-separated skus in the > favorites field in a database record. This is another instance of not using the tool to it's full potential. I have never seen a single instance of someone wanting to store multiple values in a single field that wasn't more efficiently done using multiple rows in a database instead.Create a new database favorites.db with the following columns:useridhitsSKUwhere [userid] is whatever you have as the unique identifier for the user in your visitors.db.However you want to add the items to the favorites.db initiall, set the [hits] field to 1. As they chose that same link more than once, increment the [hits] column each time. You may want to ensure that they don't have more than X number of favorites (I would suggest 10 or so as the max); you will need to create logic to replace the last record with the new item if they already have the maximum number of favorites listed.Then, when you want to display their favorites list, do a search with reverse sorting on the [hits] column and within the [founditems] loop, do a [lookup] or [search] of the products database for that item's info. This scheme will autosort their favorites in decreasing order of how favored the items it.QEDJohn-- John Peacock Director of Information Research and Technology Rowman & Littlefield Publishing Group 4501 Forbes Boulevard Suite H Lanham, MD 20706 301-459-3366 x.5010 fax 301-429-5748 ------------------------------------------------------------- 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/ John Peacock

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:

Problem 2: Prefs file... (1997) two unique banners on one page (1997) LetterRip and WebCat (1998) Banners (1997) E-mailer error codes (1997) [WebDNA] How do we tell what's misconfigured? Or which WebDNA 7 version to use? (2011) Can you do this??? and other stuff (1997) Quick ShowIf question (1997) Extended [ConvertChars] (1997) off topic, converting mail (1998) WebCat 3? (2000) I try hard to think positively (1998) Ok here is a question? (1997) Finding max value for a field (1997) WebCatalog stalls (1998) emailer (1997) Problems with [Applescript] (1997) Range in [showif] (2000) [WriteFile] problems (1997) Test (2003)