How to configure mysql connection dynamically in joomla website.
How to configure core php-mysql connection dynamically in joomla website form configuration file.
<?php
require_once "../configuration.php";
$config = new JConfig();
$host = $config->host;
$db = $config->db;
$dbprefix = $config->dbprefix;
$password = $config->password;
$user = $config->user;
$con = new mysqli($host,$user,$password, $db);
if ($con->connect_error) {
die("Connection failed: " . $con->connect_error);
}
?>
<?php
require_once "../configuration.php";
$config = new JConfig();
$host = $config->host;
$db = $config->db;
$dbprefix = $config->dbprefix;
$password = $config->password;
$user = $config->user;
$con = new mysqli($host,$user,$password, $db);
if ($con->connect_error) {
die("Connection failed: " . $con->connect_error);
}
?>
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment