CodeIgniter For Project : Workshop 005 - DAO Example
1. CodeIgniter For ProjectWorkshop 005 : DAO Example
Weerayut Hongsa : Network Engineer / Software Developer
Major Kantana Broadcasting Co., Ltd
https://kusumotolab.com
2. Test
• Create database and table use phpMyAdmin (SQL Command in next page)
• Create new CodeIgniter project and folder name “ci_workshop3”
• Create new Controller name “WorkshopController”
• Create model to select all data from database
• In “WorkshopController” create method index() and call model to show
all record
• In “WorkShopController” create method add() for add record to database
Weerayut Hongsa : Network Engineer / Software Developer
Major Kantana Broadcasting Co., Ltd
https://kusumotolab.com
3. Test
Weerayut Hongsa : Network Engineer / Software Developer
Major Kantana Broadcasting Co., Ltd
https://kusumotolab.com
CREATE TABLE `mytable` (
`id` int(11) NOT NULL,
`fname` text CHARACTER SET utf8,
`lname` text CHARACTER SET utf8
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
ALTER TABLE `mytable`
ADD PRIMARY KEY (`id`);
ALTER TABLE `mytable`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
4. Test
Weerayut Hongsa : Network Engineer / Software Developer
Major Kantana Broadcasting Co., Ltd
https://kusumotolab.com
5. Test
Weerayut Hongsa : Network Engineer / Software Developer
Major Kantana Broadcasting Co., Ltd
https://kusumotolab.com
6. Forward to Lesson 107
Weerayut Hongsa : Network Engineer / Software Developer
Major Kantana Broadcasting Co., Ltd
https://kusumotolab.com