Zope
  Home arrow Zope arrow Page 2 - The Number Game
Dev Shed Forums 
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Sun Developer Network 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Actuate Whitepapers 
VeriSign Whitepapers 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ZOPE

The Number Game
By: Harish Kamath, (c) Melonfire
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 7
    2002-04-16

    Table of Contents:
  • The Number Game
  • Reading The Funnies
  • Start Me Up
  • Rocking The Vote
  • Down Memory Lane
  • Cookie-Cutter Code
  • Adding It All Up

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    The Number Game - Reading The Funnies


    (Page 2 of 7 )

    Since I'm going to be using a MySQL database to store the poll's questions and answers, together with user responses, the first task is to design the relevant tables. Here's what I came up with:

    # # Table structure for table 'poll' CREATE TABLE poll ( qid int(10) unsigned NOT NULL auto_increment, question varchar(255) NOT NULL, response1 varchar(255) NOT NULL, response2 varchar(255) NOT NULL, response3 varchar(255) NOT NULL, votes1 int(10) unsigned DEFAULT '0' NOT NULL, votes2 int(10) unsigned DEFAULT '0' NOT NULL, votes3 int(10) unsigned DEFAULT '0' NOT NULL, date date DEFAULT '0000-00-00' NOT NULL, PRIMARY KEY (id) ); # # Column descriptions: # # qid - a unique identifier for each poll question # question - the poll question # response1 - possible response #1 # response2 - possible response #2 # response3 - possible response #3 # votes1 - number of votes for response #1 # votes2 - number of votes for response #2 # votes3 - number of votes for response #3 # date - date on which poll was posted #
    Just to get things started, I also INSERTed the first question into the database, together with three possible responses.

    # # Dumping data for table 'poll'#INSERT INTO poll (qid, question, response1, response2, response3,votes1, votes2, votes3, date) VALUES ( '1', 'The coolest comic strip ofall time is', 'Dilbert', 'Peanuts', 'Calvin and Hobbes', '0', '0', '0','2002-03-07');
    At this point, it's also a good idea to verify that your Zope installation supports MySQL via the Z MySQL Database Adapter.

    More Zope Articles
    More By Harish Kamath, (c) Melonfire


     

       

    ZOPE ARTICLES

    - Creating Zope Products
    - Plone Content Types With Archetypes
    - Flat User Management in Zope
    - Creating Basic Zope Applications
    - Getting started with Zope for Linux and Sola...
    - ZPT Basics (part 4)
    - ZPT Basics (part 3)
    - ZPT Basics (part 2)
    - ZPT Basics (part 1)
    - Exception Handling In DTML
    - DTML Basics (part 4)
    - DTML Basics (part 3)
    - DTML Basics (part 2)
    - DTML Basics (part 1)
    - Using Zope With Apache





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway