Solved

Best method to store ordered list?

Posted on 2006-11-05
6
338 Views
Last Modified: 2008-03-06
I'm looking for the optimal method for storing/retirieving  a list of items that i allow the user to sort using a php/js/html front end.

I have a "projects" table that is used to store name, dates, abstract, etc for a project. I also need to store information regarding a static list of relevant keywords. For instance a set of 10 keywords, each with a rank chosen by the user. I assume that i should use a m-m type set up with a linking table but am not sure regarding the optimal implementation. Should I create a "keywords" table, populate it with the words, then store the sort information with the linking table?
0
Comment
Question by:rolandsnowe
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 35

Expert Comment

by:Raynard7
ID: 17878667
Hi,

I would create a keyword table - populate it with the words and the ranking then link it to the other table.
0
 

Author Comment

by:rolandsnowe
ID: 17878694
Hmmm, I don't think I can store the ranking info with the keywords table, as there will be many projects each with their own individual ranking of keywords.

What I was thinking was having the keywords table, then in the linking table have the "projectsid" and "keywordsid" column, then have another column called "rank" or something that would store the rank for that particular keyword as it relates to the project.

Does that make sense? It seems like there must be a better way.
0
 
LVL 35

Accepted Solution

by:
Raynard7 earned 250 total points
ID: 17878703
Well if the rankings are dynamic - have a ranking table, a keyword table and a project table.  then have one table that links all three together.
0
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
LVL 35

Expert Comment

by:Raynard7
ID: 17878704
that way you can have as many or as few key words as you like
0
 

Author Comment

by:rolandsnowe
ID: 17885709
This is my first time posting a question, is it possible to maybe post a sample sql statement that would work for a join here, I know I already accepted the answer above, and i appreciate the help.
0
 

Author Comment

by:rolandsnowe
ID: 17886415
Nevermind about the sample, I just realized I was being foolish to begin with, I only need two tables with a third join I can store the rank info in an extra column in the join table. thanks
0

Featured Post

Why You Need a DevOps Toolchain

IT needs to deliver services with more agility and velocity. IT must roll out application features and innovations faster to keep up with customer demands, which is where a DevOps toolchain steps in. View the infographic to see why you need a DevOps toolchain.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In this article, I will by showing a nice little trick for MySQL similar to that of my previous EE Article for SQLite (http://www.sqlite.org/), A SQLite Tidbit: Quick Numbers Table Generation (http://www.experts-exchange.com/A_3570.htm…
This article shows the steps required to install WordPress on Azure. Web Apps, Mobile Apps, API Apps, or Functions, in Azure all these run in an App Service plan. WordPress is no exception and requires an App Service Plan and Database to install
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question