File: fwphp/glomodul/z_examples/book_video/03steinmetz_2008/ch12_Projects/vote_mktable

Recommend this page to a friend!
  Classes of Slavko Srakocic  >  B12 PHP FW  >  fwphp/glomodul/z_examples/book_video/03steinmetz_2008/ch12_Projects/vote_mktable  >  Download  
File: fwphp/glomodul/z_examples/book_video/03steinmetz_2008/ch12_Projects/vote_mktable
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: B12 PHP FW
Manage database records with a PDO CRUD interface
Author: By
Last change:
Date: 2 months ago
Size: 754 bytes
 

Contents

Class file image Download
DROP TABLE IF EXISTS `poll`;
DROP TABLE IF EXISTS `answer`;
DROP TABLE IF EXISTS `vote`;

CREATE TABLE `poll` (
`ID` INT NOT NULL AUTO_INCREMENT ,
`question` MEDIUMTEXT NOT NULL ,
PRIMARY KEY ( `ID` )
) TYPE = MYISAM ;

CREATE TABLE `answer` (
`answer_ID` INT NOT NULL AUTO_INCREMENT ,
`ID` INT NOT NULL ,
`answer` MEDIUMTEXT NOT NULL ,
PRIMARY KEY ( `answer_ID` )
) TYPE = MYISAM ;

CREATE TABLE `vote` (
`ID` INT NOT NULL ,
`answer_ID` INT NOT NULL ,
`ip_address` VARCHAR( 20 ) NOT NULL ,
INDEX ( `ID` )
) TYPE = MYISAM ;

INSERT INTO poll (question) VALUES ("Would you like a cheeseburger?");
INSERT INTO answer (ID, answer) VALUES (1, "Yes.");
INSERT INTO answer (ID, answer) VALUES (1, "No.");
INSERT INTO answer (ID, answer) VALUES (1, "Maybe.");

For more information send a message to info at phpclasses dot org.