• Mail Us:

Connecting with database in Codeigniter 4

Please Login and enroll in this course to view the lesson.

  • How to connect your database with your application in Codeigniter 4?
  • How to connect the database in  Codeigniter 4
  • What is Modeling Data in Codeigniter 4?
  • How to use Entity Classes in Codeigniter 4?

Well, these are the points we are going to cover in this video.

First, Create your database; in my case, I have to create the database named ci4urdu; once you create the database, then go to the app/config/Database.php file and open it, use the code below code.

 

public $default = [
        'DSN'      => '',
        'hostname' => 'localhost',
        'username' => 'root',
        'password' => '',
        'database' => 'ci4urdu',
        'DBDriver' => 'MySQLi'
    ];

That's it :)