Forum Moderators: open
And I am working on a site similar to ratemyprofessor.com / ratemyteacher.com however it is just for my fraternity.. why they cant use the regular one I don't know, but they have asked me to make one.. so anyways, if you don't know, its a website where you leave comments about a different professors and give them ratings and such. What I was thinking would be to create a table with all the professors names in one column, then in a second column, have it be filled with tables with all their ratings and comments and such, so when looking at a professors page it would be easy to find the name and pull up all the things about that specific person. Am I trying to go about this the wrong way?
Thanks
What you want to do is have a separate table for the reviews and join the data when you output the page.
Quick example:
Prof_table-
ProfID ¦ ProfName
1 ¦ Dr. Jekyll
2 ¦ Mr. Hyde
3 ¦ Dean Wormer
Review_table-
ReviewID ¦ ProfID ¦ ReviewText
1 ¦ 1 ¦ Has some identity problems...
2 ¦ 2 ¦ What a monster!
3 ¦ 3 ¦ Put HIM on double-secret probation!
4 ¦ 3 ¦ Has a friendly wife.
Now let's say you want to display the information for Dean Wormer. Your query would look something like:
SELECT Prof_table.ProfName, Review_table.ReviewText
FROM Prof_table, Review_table
WHERE Prof_table.ProfID=Review_table.ProfID