Answers for "codeigniter 4 db seed"

0

codeigniter 4 db seed

> php spark db:seed TestSeeder
Posted by: Guest on December-04-2020
0

codeigniter 4 db seed

<?php namespace App\Database\Seeds;

class SimpleSeeder extends \CodeIgniter\Database\Seeder
{
        public function run()
        {
                $data = [
                        'username' => 'darth',
                        'email'    => '[email protected]'
                ];

                // Simple Queries
                $this->db->query("INSERT INTO users (username, email) VALUES(:username:, :email:)",
                        $data
                );

                // Using Query Builder
                $this->db->table('users')->insert($data);
        }
}
Posted by: Guest on December-04-2020
0

codeigniter 4 db seed

<?php namespace App\Database\Seeds;

class TestSeeder extends \CodeIgniter\Database\Seeder
{
        public function run()
        {
                $this->call('UserSeeder');
                $this->call('CountrySeeder');
                $this->call('JobSeeder');
        }
}
Posted by: Guest on December-04-2020

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language