Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 344
  • Last Modified:

Best method to store ordered list?

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
rolandsnowe
Asked:
rolandsnowe
  • 3
  • 3
1 Solution
 
Raynard7Commented:
Hi,

I would create a keyword table - populate it with the words and the ranking then link it to the other table.
0
 
rolandsnoweAuthor Commented:
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
 
Raynard7Commented:
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
Fill in the form and get your FREE NFR key NOW!

Veeam is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

 
Raynard7Commented:
that way you can have as many or as few key words as you like
0
 
rolandsnoweAuthor Commented:
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
 
rolandsnoweAuthor Commented:
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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now