Book Image

CodeIgniter Web Application Blueprints

Book Image

CodeIgniter Web Application Blueprints

Overview of this book

Table of Contents (16 chapters)
CodeIgniter Web Application Blueprints
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Creating the database


Okay, you should have already set up CodeIgniter and Bootstrap as described in Chapter 1, Introduction and Shared Project Resources. If not, then you should know that the code in this chapter is specifically built with the setup from Chapter 1, Introduction and Shared Project Resources, in mind. However it's not the end of the world if you haven't; the code can easily be applied to other situations.

First, we'll build the database. Copy the following MySQL code to your database:

CREATE DATABASE `signupdb`;
USE DATABASE `signupdb`;

CREATE TABLE `signups` (
  `signup_id` int(11) NOT NULL AUTO_INCREMENT,
  `signup_email` varchar(255) NOT NULL,
  `signup_opt1` int(1) NOT NULL,
  `signup_opt2` int(1) NOT NULL,
  `signup_active` int(1) NOT NULL,
  `signup_created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`signup_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

Right, let's take a look at each item in the table and see what it means:

Table:...