Welcome Guest, Not a member yet? Register   Sign In
How can I connect databse from one domain to another domain?
#6

[eluser]metaltapimenye[/eluser]
easy ..
Code:
#system/application/config/database.php #@ www.one.com

$db['default']['hostname'] = "localhost";
$db['default']['username'] = "root";
$db['default']['password'] = "";
$db['default']['database'] = "dbname";
$db['default']['dbdriver'] = "mysql";
$db['default']['dbprefix'] = "";
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = "";
$db['default']['char_set'] = "utf8";
$db['default']['dbcollat'] = "utf8_general_ci";

when you need to connect to www.two.com
Code:
$group_name['hostname'] = "remote.domain2.com";
$group_name['username'] = "remote_user";
$group_name['password'] = "remote_pass";
$group_name['database'] = "db_name";
$group_name['dbdriver'] = "mysql";
$group_name['dbprefix'] = "";
$group_name['pconnect'] = TRUE;
$group_name['db_debug'] = TRUE;
$group_name['cache_on'] = FALSE;
$group_name['cachedir'] = "";
$group_name['char_set'] = "utf8";
$group_name['dbcollat'] = "utf8_general_ci";

$this->load->database('group_name'); #connecting to www.two.com database

.. of course you need to provide remote account at www.two.com


Messages In This Thread
How can I connect databse from one domain to another domain? - by El Forum - 06-17-2010, 03:36 AM



Theme © iAndrew 2016 - Forum software by © MyBB