nadeltanz 0 Posted May 30, 2012 Report Share Posted May 30, 2012 Re script 3 2 which I have customized to fit a webpage of mine on political cartoons...I replaced excellent with "funny" etc...so that is the project. What I would like is info on how to tally the votes I place on each cartoon and a sum of those votes. Just a general idea of what I should do next is O.K. because I am new at PHP. I know CSS and HTML, that's it. So, I would like to be pointed to info where I can learn to tally my votes and see that the tally corresponds to the votes I make. I have of course this book edition on my Kindle, and think it will give me the basics in which I am now beginning. Thanks..Nadeltanz Quote Link to post Share on other sites
HartleySan 826 Posted May 30, 2012 Report Share Posted May 30, 2012 I suppose something as simple as adding an additional column to the DB for each cartoon for the number of "likes" would be sufficient. Each time someone clicked the "Like" button, you could increment the counter in the DB for that cartoon by 1. And when you're displaying the cartoons, you'd just pull the "likes" column from the DB as well. The tricky part would probably be making sure that the "Like" button for an individual cartoon could only be clicked once per user. Quote Link to post Share on other sites
Larry 433 Posted May 30, 2012 Report Share Posted May 30, 2012 HartleySan's suggestion will work fine. If you need to be more exacting, such as limiting each person to one like, you'd need to create a separate likes table with the cartoon id and the user id as the composite key. You could then use fancy SQL to count the likes. Quote Link to post Share on other sites
nadeltanz 0 Posted May 31, 2012 Author Report Share Posted May 31, 2012 O.k. so it looks as though it's about the db. I have a cursory knowledge of such, as far as dl xampp and running through a number of tutorial lessons re. Thanks I know what to look into. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.