0

Hello all. I am making a website that requires put reviews into my database. I have restaurant sections. I want to have reviews stores per restaurant. When it comes to mysql data tables i can only imagen having one column for reviews then giving each picture an id to accociate with the proper web site. Is there a better way to do this that wont take too much computer time , thanks?

2
Contributors
3
Replies
4
Views
5 Years
Discussion Span
Last Post by mikulucky
0

I would have two tables, one table that holds a list of restaurants, each with their ID. While the other table holds the reviews against them. For the review table, have a column that holds the ID of the restaurant that the review applies. When it comes to displaying the data, you could then use a MYSQL JOIN on this value to show each restaurant with all their reviews.

So the restaurant table fields:

  • PlaceID
  • Name
  • Address
  • Image

The Review Table

  • ReviewID
  • ReviewName
  • Rating
  • ReviewText
  • PlaceID

Therefore there will be a relation between the two tables based on the PlaceID, this also means that you can have multiple reviews for each restaurant.

Hope this helps :)

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.