Re: [PHP-DB] Polls?

2002-11-09 Thread Peter Beckman
Well, you are gonna have to do two queries if you want a dynamic number of questions in each poll, unless you want to do something limited and have 10 to 20 columns for each poll and leave the questions not questioned null... IE: table poll pollid name descr question1 question2 question3

Re: [PHP-DB] Polls?

2002-11-08 Thread Peter Beckman
Use the dual table questions and answers suggestion before. Then just use a loop: $question = mysql_query(select * from questions where id={$this_question}); while ($r = mysql_fetch_array($question)) { $answers = mysql_query(select * from answers where qid={$r[id]}); while ($s =

Re: [PHP-DB] Polls?

2002-11-08 Thread Leif K-Brooks
The problem is, I need to make a page that shows all of the polls, and one query per poll would kill the server. Peter Beckman wrote: Use the dual table questions and answers suggestion before. Then just use a loop: $question = mysql_query(select * from questions where id={$this_question});

Re: [PHP-DB] Polls?

2002-11-08 Thread Mihail Bota
Leif, off the wall...what if you have a table for question, identified with an unique ID, and another where you store the results? BTW: how are the questions? Yes/No, or multiple choices, or combination of these two styles? On Fri, 8 Nov 2002, Leif K-Brooks wrote: The problem is, I need to

[PHP-DB] Polls?

2002-11-07 Thread Leif K-Brooks
I'm working on a polling system, and I'm having a bit of a problem. I'm not sure how to store the questions. Storing them in a seperate table would require a query for each poll displayed - not good. I've also thought of storing them as a serialized array. Any thoughts on this? -- The

Re: [PHP-DB] Polls?

2002-11-07 Thread Leif K-Brooks
- Original Message - From: Leif K-Brooks [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, November 08, 2002 8:15 AM Subject: [PHP-DB] Polls? I'm working on a polling system, and I'm having a bit of a problem. I'm not sure how to store the questions. Storing them in a seperate