Connection to a database is not out of the box in CodeIgniter. Let's see how to configure our application to connect to one.
- [Instructor] One of the most useful features…of a framework is its ability to connect to a database.…In this example, we'll be connecting…to the database that we set up previously.…Let's hop into phpMyAdmin to make sure the database exists.…So let's first load our code, and Desktop, Exercise Files,…Chapter One, 01_06_start, we'll start the server,…Desktop/ExerciseFiles/Ch01/01_06_start/,…and php -S localhost:8080…Let's open up the browser and open up…another tab with localhost:8888…and phpmyadmin.…
And we make sure that the database ci_course exists.…Now let's open up the file, application, config, database.…And let's set up the environment variables that we'll…be using to connect to the database.…We'll be using the index username, password, and database.…And we'll be using the environment array called ENV…with an index that we set up ourselves, called 'DB_USER',…and since we'll be using the same array, let's just…copy and paste and change the index.…
'DB_PASSWD' and 'DB_NAME'.…For now those environment variables won't be defined.…
- Loading views and data from containers
- Routing with controllers
- Creating models
- Configuring the data
- Working with data, forms, sessions, and headers
- Logging and error logging
- Extending CodeIgniter to consume dependencies
Skill Level Beginner
PHP: Clean URLs on Apache Serverwith David Powers1h 36m Intermediate
PHP: Managing Persistent Sessionswith David Powers2h 41m Intermediate
1. Get Started with CodeIgniter
2. Work with Data, Logs, Forms, and Headers
3. Take CodeIgniter Further
CodeIgniter and Composer3m 13s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.