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 you have 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 projects and applications you may have developed independently.

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

CREATE DATABASE `imagesdb`;
USE `imagesdb`;

DROP TABLE IF EXISTS `images`;
CREATE TABLE `images` (
  `img_id` int(11) NOT NULL AUTO_INCREMENT,
  `img_url_code` varchar(10) NOT NULL,
  `img_url_created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `img_image_name` varchar(255) NOT NULL,
  `img_dir_name` varchar(8) NOT NULL,
  PRIMARY KEY (`img_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

Right, let's take a look...