Solved

Best method to store ordered list?

Posted on 2006-11-05
6
335 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
  • 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
Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

 
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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Foreword This is an old article.  Instead of using the MySQL extension that was used in the original code examples, please choose one of the currently supported database extensions instead.  More information is available here: MySQLi / PDO (http://…
I have been using r1soft Continuous Data Protection (http://www.r1soft.com/linux-cdp/) for many years now with the mySQL Addon and wanted to share a trick I have used several times. For those of us that don't have the luxury of using all transact…
Concerto provides fully managed cloud services and the expertise to provide an easy and reliable route to the cloud. Our best-in-class solutions help you address the toughest IT challenges, find new efficiencies and deliver the best application expe…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

930 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now