Assume that the user has two databases hosted on one host and I need to join them so that I Any time you can add a connection code without using a table.
I implemented it in CodeIgniter to add the authentication details of both the databases in the database.php
file and load the required database with the $-> Load-> Database ('dbname');
In the script
Now, for the basic PHP, we can do this:
mysql_connect ('host', 'user', 'password', 'Port', 'dbname'); // Connection with a database
This was connected to my first database.
Now, I want to connect to another database:
1) I have not closed up the connection and with the other
mysql_connect (' Host ',' user ',' password ',' port ',' dbname1 ');
2) Would it be bad practice to do this? Will it consume more items? Do we have to first stop anyway?
No comments:
Post a Comment