Welcome Guest, Not a member yet? Register   Sign In
Database Connection (Confused by the bible)
#1

[eluser]Lost_all_hope[/eluser]
Hello

I want to connect to MySQL database, but reading the bible has some what confused me!

I've put my username and password in config/database.php it then tells me in the bible

user_guide\database\connecting.html to Autoconnect to add database to config/autoload.php

Code:
$autoload['libraries'] = array('database');

and do I need to add the following to config/config.php

Code:
$this->load->database($db);

Is this the correct way to make sure it's alive no matter what model I create? or do I still have to add some more code within each model to make sure it's connecting? if not what exactly do I have to?

Also so's not to clogg up this forum with random posts, I want to create a simple navigation pulled from a Database table, whats the best approch for this?

Thanks in advance

Mal


Messages In This Thread
Database Connection (Confused by the bible) - by El Forum - 10-20-2010, 01:54 AM
Database Connection (Confused by the bible) - by El Forum - 10-20-2010, 02:38 AM
Database Connection (Confused by the bible) - by El Forum - 10-20-2010, 02:57 AM
Database Connection (Confused by the bible) - by El Forum - 10-20-2010, 03:32 AM



Theme © iAndrew 2016 - Forum software by © MyBB