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:

Why do extra quotation marks sometimes appear in my databases? (1998) Sort Order on a page search (1997) RE: Formulas.db + Users.db (1997) Emailer setup (1997) form data submission gets truncated (1997) IP Address (2001) [WebDNA] form data compared to existing database (2016) Almost There But? WebCat Keeps Changing Cart Numbers onMe! (2002) Using Applescript to process WebCatalog functions (1998) how many users (2000) New Guestbook Source (1997) Running _every_ page through WebCat ? (1997) Re(2):Foreign Chars ( éàöäand so on) (1998) Draft Manual, Tutorial, and more (1997) can webcat create directories on NT? (1997) ACGI processing for .html (1997) Graphical display of sales volume (2003) Help name our technology! I found it (1997) WebCat2 - many [carts] on one template page? (1997) Digest for 09-30-97 (1997)