I have aleady use mysqli for the main connection, but use this mysql for additioal connection on particular page.
class DBController {
private $host = "localhost";
private $user = "root";
private $password = "";
private $database = "blog_samples";
function __construct() {
$conn = $this->connectDB();
if(!empty($conn)) {
$this->selectDB($conn);
}
}
function connectDB() {
$conn = mysql_connect($this->host,$this->user,$this->password);
return $conn;
}
Is it good & safe enough? Are there better way for doing this? please explain me the advantage. Thanks in advance