Welcome Guest, Not a member yet? Register   Sign In
Building and optimising a voting app with CI


I'd appreciate any help you can offer, though not sure if is more suited for a SQL forum - I'm currently trying to decide on a schema for a voting app I'm building in CI + MySQL, but I'm completely stuck on how to optimise it. The key elements are to allow only one vote per user per item, and be able to build a chart detailing the top items of the month – based on votes received that month.

So far the initial schema is:

(lots of other fields unrelated to voting)

vote (1 = up; 0 = down)

So I'm wondering if it's going to be a case of selecting all information from voting table where month = currentMonth & year = currentYear, somehow running a count and grouping by item_id; if so, how would I go about doing so? Or would I be better off creating a separate table for monthly charts which is updated with each vote, but then should I be concerned with the requirement to update 3 database tables per vote?

I'm not particularly competent – if it shows! – so would really love any help / guidance someone could provide.


Hey i've started a similar project if you want i can help you Smile
Here's the short history
private (only users that are invited)
public all users can vote
state only users from a particular state can vote

poll image (user upload a picture)
poll video (user upload a video)
poll text simple

multiple choices

show votes
chart votes
facebook twitter login
account settings
edit profile (in one word a3m auth)
album photos
album videos
events create
and much more...basiclly it's a social network build around the poll voting sistem very complex.

Theme © iAndrew 2016 - Forum software by © MyBB