Dear,

I have two database connection files. It is possible to use them to connect with two database instead of one only? this code shown below is the coding of one of them to connect with the particular database. The other file is used for username and password of the database.

to be onest with you the two databases use the same username and password and only me login in db because it is my portfolio.

<?php
require("dbconn.php");
//create a new instance of the db connection
$db = new dbconn();
//set the database name for the application
$db->setdbname("blabla_blabla");
?>

Thanks.
Mario

Yes, it's possible like you described. Solution depends on how you want to use it. If you want a more detailed answer, share both your files (remove your credentials) and give an example of what you want to achieve.

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.