in reply to Voting script using MySQL and DBI

Why are you hard coding each individual option? After you retrieve your opions from the database, you store them in an array, so why not loop like so:
use strict; my @options = ( 'Perfect for me', 'Okay, but my first choice was taken', 'My real name, blame my parents', 'Cowboy Neal', ); for (0..$#options) { print "<tr>\n<td align='left' bgcolor='#8f4141'>\n"; print "<font color='#eabf12' size='2'>\n"; print qq|<input name="in_vote" type="radio" value="option_$_">$opti +ons[$_]</font>\n|; print "</td>\n</tr>\n"; }
This is much better, not only because you do not repeat redundant code, but because you are working on N options, not a finite number, like six. But multiple print statements are icky - learn to avoid them now. One alternative is to let CGI.pm do the hard work for you. Also, where are your opening and closing <table> tags? And why are you exiting at the end of the subroutine?

Lastly, your database schema is, i am sorry to say, not very good at all. At it's very simplest, you only need three tables (not including tables for user info):

Poll
  1. id (primary key)
  2. user_id (foreign key from user table - user who started poll)
  3. description
  4. date_started
  5. date_ended
Option
  1. id (primary key)
  2. poll_id (foreign key to poll table - which poll does this option belong to)
  3. number (what order to place in poll)
  4. description
Vote
  1. user_id (foreign key to user table - who voted on this option)
  2. option_id (foreign key to option table - which option was voted on)
If you wanted to get a list of the options for the poll whose id is 42, you could issue the following query:
select option.description from option inner join poll on option.poll_id = poll.id order by option.number
If you wanted to get the taly of votes from poll 42 ... well, i will leave that as an excercise. >:) Working with properly designed database tables requires a lot of dilligent effort. Maybe you should be working on something a tad bit less challenging, like learning CGI.pm and templating solutions, before you jump right into databases.

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)