1. Home
  2. Computing & Technology
  3. PHP / MySQL

Simple PHP & MySQL Poll

By Angela Bradley, About.com

1 of 5

Making the Database

This tutorial will demonstrate how to make a basic poll using PHP, and store the results in MySQL. We will then display the results by making a pie chart with the GD Library.

The first thing we must do is create a database. Our example our poll will have three options, however you can modify this to fit your needs.

CREATE TABLE votes (first INTEGER, sec INTEGER, third INTEGER);
INSERT INTO votes (first, second, third) VALUES (0,0,0)

1 of 5

Explore PHP / MySQL

More from About.com

  1. Home
  2. Computing & Technology
  3. PHP / MySQL
  4. Graphics- GD Library
  5. Simple PHP Poll - Graphical PHP Poll - PHP Poll Tutorial

©2008 About.com, a part of The New York Times Company.

All rights reserved.