Re: [PHP] Writing a Polling App - Need Some Advice

2002-11-21 Thread Kevin Stone
Somebody suggested downloading a pre-made script that does what you want but
I say that's no way to program.  Simple scripts like this one clear the mind
and are good experience.  Besides nobody ever got good at programming by
using pre-made scripts.  ;-)

Okay down to basics.  You can break up the problem into logical steps.  The
way I would do this is have two tables.  The first table stores the poll_ID,
name (or title), start_date, end_date.  The second table stores poll_ID,
question, hits.  If you need to prevent users from inputing more than one
answer you can store a third table containing, poll_ID, IP.

Your only redundency is the poll_ID value.  This is your associating value
that binds the poll data together.   In the first table this should be your
Primary Key and set it as an auto-incrementing unsigned integer.  In the
second and third tables set it to integer and leave it alone.  You might add
a separate auto-incrementing value to act as the primary key.

So hopefully this gets you started.  If you need help with anything else let
me know.
-Kevin


- Original Message -
From: "Monty" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, November 21, 2002 12:30 PM
Subject: [PHP] Writing a Polling App - Need Some Advice


> I'm writing a little polling app for a website, they want to run them each
> week. They will be the simple "choose your favorite" kind of
multiple-choice
> polls.  If anyone has ever written one of these, what is the best way to
set
> up the poll questions? Do I store each question in a separate table and
link
> them to a central "Poll" record? Or do you store the questions all in one
> record? Or is there an even better way to do this?
>
> Any suggestions or pointers would be appreciated! Thanks.
>
> Monty
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Writing a Polling App - Need Some Advice

2002-11-21 Thread Monty
I'm writing a little polling app for a website, they want to run them each
week. They will be the simple "choose your favorite" kind of multiple-choice
polls.  If anyone has ever written one of these, what is the best way to set
up the poll questions? Do I store each question in a separate table and link
them to a central "Poll" record? Or do you store the questions all in one
record? Or is there an even better way to do this?

Any suggestions or pointers would be appreciated! Thanks.

Monty



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php