- CodeIgniter Web Application Blueprints
- Rob Foster
- 243字
- 2021-08-06 19:34:29
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—the code can easily be applied to other situations.
Firstly, we'll build the database. Copy out the following MySQL code into your database:
CREATE DATABASE `urls`; USE `urls`; CREATE TABLE `urls` ( `url_id` int(11) NOT NULL AUTO_INCREMENT, `url_code` varchar(10) NOT NULL, `url_address` text NOT NULL, `url_created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`url_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
Let's take a look at what each item in the database means:

We'll also need to make amends to the config/database.php
file—namely setting the database access details, username password, and so on.
Open the config/database.php
file and find the following lines:
$db['default']['hostname'] = 'localhost'; $db['default']['username'] = 'your username'; $db['default']['password'] = 'your password'; $db['default']['database'] = 'urls';
Edit the values in the preceding lines. Ensure you substitute those values with the ones that are more specific to your setup and situation—so enter your username, password, and so on.
- LabVIEW2018中文版 虛擬儀器程序設(shè)計(jì)自學(xué)手冊
- Learning Chef
- NumPy Essentials
- Java高并發(fā)核心編程(卷1):NIO、Netty、Redis、ZooKeeper
- CoffeeScript Application Development Cookbook
- Statistical Application Development with R and Python(Second Edition)
- Go語言開發(fā)實(shí)戰(zhàn)(慕課版)
- Instant jQuery Boilerplate for Plugins
- Java7程序設(shè)計(jì)入門經(jīng)典
- OpenCV Android開發(fā)實(shí)戰(zhàn)
- Visual Basic 程序設(shè)計(jì)實(shí)踐教程
- Python數(shù)據(jù)可視化之matplotlib實(shí)踐
- F# for Machine Learning Essentials
- Visual C++.NET(2008)典型案例
- MySQL高可用實(shí)踐