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

Simple PHP & MySQL Poll

By , About.com Guide

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)
Explore PHP / MySQL
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

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

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

All rights reserved.