• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Dynamic DB Connection

#7
[eluser]exodus7[/eluser]
The user guide shows you how to connect to the database manually like so:

Code:
$config['hostname'] = "localhost";
$config['username'] = "myusername";
$config['password'] = "mypassword";
$config['database'] = "mydatabase";
$config['dbdriver'] = "mysql";
$config['dbprefix'] = "";
$config['pconnect'] = FALSE;
$config['db_debug'] = TRUE;
$this->load->database($config);

you can set your variables to = what's in your session like so: $config['hostname'] = $this->session->userdata('item');

Read more about it at: http://ellislab.com/codeigniter/user-gui...cting.html

I'm no expert but If your looking to keep your clients db secure, I would suggest a different alternative than creating multiple databases - its a waste of time, $$$, and resources in my opinion.

Good luck in your project


Messages In This Thread
Dynamic DB Connection - by El Forum - 03-03-2008, 11:42 AM
Dynamic DB Connection - by El Forum - 03-03-2008, 01:45 PM
Dynamic DB Connection - by El Forum - 03-03-2008, 01:46 PM
Dynamic DB Connection - by El Forum - 03-03-2008, 02:30 PM
Dynamic DB Connection - by El Forum - 03-03-2008, 02:46 PM
Dynamic DB Connection - by El Forum - 03-03-2008, 03:04 PM
Dynamic DB Connection - by El Forum - 03-03-2008, 03:06 PM
Dynamic DB Connection - by El Forum - 03-03-2008, 03:45 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.