hi all,

i just want to ask if its possible to have a two or even more database connection in a php run application
like

db_connect---db1
fetch data

db_connect--db2
fetch data
db_close --db2

if its not possible.
how can i get data from other database table
appriciate youre answers.

Recommended Answers

All 3 Replies

You should be able to interact with multiple databases without needing multiple connections open from php. Check out the mysql use command.

You can also reference the databases directly in your query.

SELECT * FROM db1.tableA;
SELECT * FROM db2.tableA;

what if they both database dont have the same database server would it be matter?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.