I'm working on a contest where users vote for contestants. Each contestant will have a bio. I was wondering what would be the best way to approach this? Should I do this in php or javascript? Should I use a database to collect data? Should I use sqlite3? If I use sqlite3 how do i install that on my mac? I'm very new to all this but I'm a quick learner. Thanks for any advice.
You will have to use PHP for this if you want people from all over to be able to vote. JavaScript is client sided [ok fine, there's SSJS, but that isn't common]...
Code is simple
<?php
mysql_connect(addr, usr, pass) or die(mysql_error());
mysql_select_db(dbName) or die(mysql_error());
//To vote for user0
mysql_query("UPDATE tableName SET votes=votes+1 WHERE candidateId=0");
?>
... of course you'd have to have a method of determining the same user viewing your site from a different user [No, session isn't appropriate. Cookies can be circumvented as well]
Format for table "tableName":
***************************************************
* candidateId - int - autoincrement * votes - int *
***************************************************
* 0 * 0 *
* 1 * 0 *
***************************************************
It sounds like you're new to creating dynamic websites. I would suggest googling how to set yourself up a basic LAMP setup (Linux or your operating system of choice, an apache web server, MySql, and PHP). There are installers (like XAMPP for instance) that will install all the stuff you need.
Once you get that started you can start diving into some tutorials. If you're looking for one close to your goal project, this one looks promising: http://ad1987.blogspot.com/2009/02/reddit-style-voting-with-php-mysql-and.html
You can just add a bio field to the table they're using in that tutorial and boom, done.
Good Luck!
If you wanted to take all the fun out of it, you could try to tailor a service like http://www.surveymonkey.com/ to fit your solution. Of course, this being a programmer's web site...