1. Computing

Simple PHP & MySQL Poll

By , About.com Guide

1 of 5

Making the Database
Simple PHP & MySQL Poll
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) 
Related Video
Basic PHP Syntax
Using PHP With HTML
  1. About.com
  2. Computing
  3. PHP / MySQL
  4. Graphics- GD Library
  5. Simple PHP Poll - Graphical PHP Poll - PHP Poll Tutorial

©2013 About.com. All rights reserved.