Welcome Guest, Not a member yet? Register   Sign In
is it possible to use both of MySQL & MSSQL
#1

[eluser]DeaD SouL[/eluser]
Hello everyone..


I have a new project.. and its kindda complicated..

and i have to use both of MySQL and MSSQL

because I'll create the main fronted & backend areas using MySQL driver..
and there is another section for the "online payment" and i should connect this section with their database which is hosted on their server.. because they have a software that used to update their clients and i have to connect it with the website specially the "online payment"

so, i was wondering... can i make MySQL is the default database-driver,
and the MSSQL just for certain folder and its contents?

thanks a lot for any help Smile
#2

[eluser]rogierb[/eluser]
sure you can, just create a second db connection under a different name like:

$db['second_database']['hostname'] = "localhost";
$db['second_database']['username'] = "my_username";
$db['second_database']['password'] = "my_passwor";
$db['second_database']['database'] = "My_database";
$db['second_database']['dbdriver'] = "mssql";
$db['second_database']['dbprefix'] = "";
$db['second_database']['pconnect'] = TRUE;
$db['second_database']['db_debug'] = TRUE;
$db['second_database']['cache_on'] = FALSE;
$db['second_database']['cachedir'] = "";
$db['second_database']['char_set'] = "utf8";
$db['second_database']['dbcollat'] = "utf8_general_ci"

and then connect to it like:
$this->second_database = $this->load->database('second_database', TRUE);

And use that in the connection to the external mssql db.
#3

[eluser]DeaD SouL[/eluser]
thanks a lot rogierb Big Grin




Theme © iAndrew 2016 - Forum software by © MyBB