Wednesday, 21 January 2015

getting started with codeigniter

Codeigniter
Download codeigniter from here, unzip the file in your project directory, that is htdocs if you are using XAMPP or www if are working with WAMP.
As we unzip the file it has the following files;
               


I have unzip the file the htdocs directory, and rename it to CI_First. Now as I open the browser and go to localhost/CI_First, We’ll see the following page;



If you see the page you are going fine. Now we will open the file in our favourite text editor. Mine is Zend Studio. The project file look like this in Zend Studio.  

Now we are good to go.
Connecting database;
 Codeigniter makes it easy to connect to database, go to application/config/database.php and make the following chages.
$db['default']['hostname'] = 'localhost';
$db['default']['username'] = 'root';//username is usually root
$db['default']['password'] = '';//no password as default
$db['default']['database'] = 'test';//database name
$db['default']['dbdriver'] = 'mysql';//database type

the database.php file look like this;




Now go to browser and localhost/CI_First if no error occurred you have successfully connected to the database.

No comments:

Post a Comment