All,
I'm designing a new site that is posing a slight challenge, something I haven't had to do before. Viewers to the site need to be able to create a favorites list that they can pull up once they have logged in. I'm looking for advice on the best way to setup the table structure in the database.
Here's my thoughts. I have table called "favorites" in my db. Every time a property is chosen to be added as a favorite, the user id and the rental id are passed to the query which then adds the two bits of information to the table. Then when I want to display them on the users profile, I query the favorites table for all instances of the user id and output them to the screen as clickable links.
To me this seems the most logical and the structure of the table would be a simple 2 columns:
table: favorites
+--------------+-----------------+
| userID | propertyID |
+--------------+-----------------+
Thoughts on this? TIA!