I have not started creating the code so I don’t have anything to show, but what I am going to create is a simple button after each post on my website that allows users to “Like” the post. The only problem I have is figuring out what my MySQL table should look like for this feat. I want to add a ‘rating’ column in my ‘tbl_posts’ table that stores the count, but I’m not sure how to make it so that each user can only upvote the post once. Any ideas on how to create the database in this way?
Also, I want to create the “Like” button using jQuery. What do you recommend is the best way to create the Like button.
Gracias.
If you’re talking about registered users on your page you could create a user_likes_post m:n relation between your post and user tables.
If you’re talking about page visitors you’ll have to resort to IP addresses and/or cookies to make sure everyone can upvote only once.
For the button itself i’d recommend jQuery UI