How to configure mysql connection dynamically in joomla website.

No comments
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);
    }
?>

No comments :

Post a Comment