Welcome Guest, Not a member yet? Register   Sign In
CodeIgniter Tutorial News section
#6

(07-28-2015, 02:30 AM)Wouter60 Wrote: Inside the application/config folder you will find a file named "database.php".
Modify this file according to the correct database settings.
Once you've done that, calling the database library [ with $this->load->library('database') ] will establish the right connection.
To run sql commands, you do this:

PHP Code:
$this->db->query("SELECT * FROM ..."); 

And that's just one of the many methods in the database library. Studying the documentation about running database queries can help you a lot.

Important! If you are planning to use a local database for your development environment, and another database for your production environment, make two versions of database.php. One in application/config/development, the other in application/config/production.
CI will use the correct file, depending on the environment setting in your index.php file.

Thanks Wouter60. I have already created a database and configured "database.php" and modified "autoload.php" to $autoload['libraries'] = array('database', 'email', 'session');

I like to learn how to create the table automatically using PHP and in accordance with the Tutorial. Undoubtedly when the table is created the Tutorial will explain the query process.

I'm intending to build only one project and doubt if I'll need development and production environments.
Reply


Messages In This Thread
RE: CodeIgniter Tutorial News section - by christaliise - 07-28-2015, 08:15 AM



Theme © iAndrew 2016 - Forum software by © MyBB