1<?php namespace App\Database\Seeds;
2
3class SimpleSeeder extends \CodeIgniter\Database\Seeder
4{
5 public function run()
6 {
7 $data = [
8 'username' => 'darth',
9 'email' => 'darth@theempire.com'
10 ];
11
12 // Simple Queries
13 $this->db->query("INSERT INTO users (username, email) VALUES(:username:, :email:)",
14 $data
15 );
16
17 // Using Query Builder
18 $this->db->table('users')->insert($data);
19 }
20}
21
1<?php namespace App\Database\Seeds;
2
3class TestSeeder extends \CodeIgniter\Database\Seeder
4{
5 public function run()
6 {
7 $this->call('UserSeeder');
8 $this->call('CountrySeeder');
9 $this->call('JobSeeder');
10 }
11}
12