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?

Recommended Answers

All 3 Replies

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 :)

thanks your right and it did

Thats good, could you please mark as solved, and give rep as you feel appropriate.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.