From 1dd09d0158d5b5961b8bce4db0b9a142700480d5 Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Sun, 9 Dec 2007 20:00:43 +0000 Subject: userguide fixes, typos, examples. --- user_guide/database/configuration.html | 141 +-------------------------------- 1 file changed, 1 insertion(+), 140 deletions(-) (limited to 'user_guide/database') diff --git a/user_guide/database/configuration.html b/user_guide/database/configuration.html index 9c679c967..b8504184c 100644 --- a/user_guide/database/configuration.html +++ b/user_guide/database/configuration.html @@ -1,140 +1 @@ - - - - -CodeIgniter User Guide : Database Configuration - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -

CodeIgniter User Guide Version 1.5.4

-
- - - - - - - - - -
- - - -
- - - -
- - -

Database Configuration

- -

CodeIgniter has a config file that lets you store your database connection values (username, password, database name, etc.). -The config file is located at:

- -

application/config/database.php

- -

The config settings are stored in a multi-dimensional array with this prototype:

- -$db['default']['hostname'] = "localhost";
-$db['default']['username'] = "root";
-$db['default']['password'] = "";
-$db['default']['database'] = "database_name";
-$db['default']['dbdriver'] = "mysql";
-$db['default']['dbprefix'] = "";
-$db['default']['pconnect'] = TRUE;
-$db['default']['db_debug'] = FALSE;
-$db['default']['active_r'] = TRUE;
- -

The reason we use a multi-dimensional array rather than a more simple one is to permit you to optionally store -multiple sets of connection values. If, for example, you run multiple environments (development, production, test, etc.) -under a single installation, you can set up a connection group for each, then switch between groups as needed. -For example, to set up a "test" environment you would do this:

- -$db['test']['hostname'] = "localhost";
-$db['test']['username'] = "root";
-$db['test']['password'] = "";
-$db['test']['database'] = "database_name";
-$db['test']['dbdriver'] = "mysql";
-$db['test']['dbprefix'] = "";
-$db['test']['pconnect'] = TRUE;
-$db['test']['db_debug'] = FALSE;
-$db['test']['active_r'] = TRUE;
- - -

Then, to globally tell the system to use that group you would set this variable located in the config file:

- -$active_group = "test"; - -

Note: The name "test" is arbitrary. It can be anything you want. By default we've used the word "default" -for the primary connection, but it too can be renamed to something more relevant to your project.

- -

Explanation of Values:

- - - -

Note: Depending on what database platform you are using (MySQL, Postgre, etc.) -not all values will be needed. For example, when using SQLite you will not need to supply a username or password, and -the database name will be the path to your database file. The information above assumes you are using MySQL.

- - - -
- - - - - - - \ No newline at end of file + CodeIgniter User Guide : Database Configuration

CodeIgniter User Guide Version 1.5.4


Database Configuration

CodeIgniter has a config file that lets you store your database connection values (username, password, database name, etc.). The config file is located at:

application/config/database.php

The config settings are stored in a multi-dimensional array with this prototype:

$db['default']['hostname'] = "localhost";
$db['default']['username'] = "root";
$db['default']['password'] = "";
$db['default']['database'] = "database_name";
$db['default']['dbdriver'] = "mysql";
$db['default']['dbprefix'] = "";
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = FALSE;
$db['default']['active_r'] = TRUE;

The reason we use a multi-dimensional array rather than a more simple one is to permit you to optionally store multiple sets of connection values. If, for example, you run multiple environments (development, production, test, etc.) under a single installation, you can set up a connection group for each, then switch between groups as needed. For example, to set up a "test" environment you would do this:

$db['test']['hostname'] = "localhost";
$db['test']['username'] = "root";
$db['test']['password'] = "";
$db['test']['database'] = "database_name";
$db['test']['dbdriver'] = "mysql";
$db['test']['dbprefix'] = "";
$db['test']['pconnect'] = TRUE;
$db['test']['db_debug'] = FALSE;
$db['test']['active_r'] = TRUE;

Then, to globally tell the system to use that group you would set this variable located in the config file:

$active_group = "test";

Note: The name "test" is arbitrary. It can be anything you want. By default we've used the word "default" for the primary connection, but it too can be renamed to something more relevant to your project.

Explanation of Values:

Note: Depending on what database platform you are using (MySQL, Postgre, etc.) not all values will be needed. For example, when using SQLite you will not need to supply a username or password, and the database name will be the path to your database file. The information above assumes you are using MySQL.

\ No newline at end of file -- cgit v1.2.3-24-g4f1b