Online photo contest? (php & MySql)

I’ve been assigned the task of creating an online photo contest for work-the photos will be taken and uploaded by us, but needs to be in a format that would allow for people to vote-setting up the MySql db & file upload, plus displaying the contents is easy enough, I’m just not sure how to set up the voting part-
any ideas? also, one MySql question-I’ve set up databases for text but is there
any special consideration for images? what is the field type for images?


Store the image name (or path) in the db as text.
For voting just create a form that submits the image id (or name, as long as it’s unique) and +1 the vote count field (table, whatever you have set up).

Agree with hash, upload images to file system. Unless you have a complex layered category system then stuff them all into one folder.

Keep the metadata about each photo in a db, as was said.

Think about how your voting system could be abused, and cater for ways to avoid that happening.

Stoping abuse is the biggest problem with voting, explaining enough about how you are stopping abuse is the biggest challenge when explaining to your users that your competition is going to be fair.

on those points
this tropic might be of help

Hey thanks for all of the suggestions. It has been awhile since I’ve set up any image based database, so thanks for reminding me about how to do it .
And this seems like a good way to do the voting- the main abuse I would worry about it people voting multiple times, which I don’t want. I’m thinking that in order to vote, they’ll have to log in-and will only be allowed to do so one time.
(I suppose if they create a different email/username combo they could thwart this system though…)

anyways, thanks for the suggestions, I’ll get to work and see how it goes from here!:cool:

I have a similar system… with the image path/name and id stored in the database. I log the ip addess of the last voter and the votes in the same table… that way they cant cast another vote untill someone else votes and the ip address is updated. By that time they have most likely closed the browser and have no interest in revoting. To make it even secure, create another table… Log the photo id and the voters ip and check against that table in your query before updating the votes field.

about multiple voting
well ,yup it sounds simple but i think it is something very big tropic for discussion…
I think it is just like two side of the coin…both have some pros and cons
If you use style you have mentioned…
may be you will have very less number of people voting unless your site is very popular.
People dont want to register every another site,go to their email and confirm and remember username and password…
so in most cases unless visitor is very very much impressed,she wont take than all fosss just to vote.
People will see,feel good or bad and leave.

More accurate than others.(Depends upon implementation as well,about multi registration you said,you can still use an ip or cookie check)

Cookie or Ip method
Higher participation which means factual results.

It has been much vunerable to attacks and tweaking which doesnt give accurate info.
Lots of scripts and software and plugins now which is created with the purpose of manipulating it.
Some years ago in one of my poll,5000 votes were registered with in half an hours for one option :smiley:

so i think it is big question how things can be implemented…

Is this photo competition/application to be housed on an intranet, rather than just “the web”?