Re: Polls?
| From: | Leif K-Brooks | Date: | Fri, 08 Nov 2002 16:52:20 +0000 |
| Subject: | Re: Polls? | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-23154@lists.php.net to get a copy of this message | ||
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}"); while ($r = mysql_fetch_array($question)) { $answers = mysql_query("select * from answers where qid={$r[id]}"); while ($s = mysql_fetch_array($answers)) {-- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.print "<question input and labels>";} } On Fri, 8 Nov 2002, Leif K-Brooks wrote: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 above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php---------------------------------------------------------------------------Peter Beckman Systems Engineer, Fairfax Cable Access Corporation beckman@purplecow.com http://www.purplecow.com/---------------------------------------------------------------------------