📲 Download Our Apps

EMI Calculator

Download EMI Calculator

SOA Games

Download SOA Games

SOA Technology App

Download SOA Technology

BMI Checker

Download BMI Checker

Task Jira

Download Task Jira

Laughing Adda

Download Laughing Adda

📅 हिंदी कैलेंडर ऐप डाउनलोड करें

Download Shubhcalendar App

Use multiple databases in OpenCart

Use multiple databases in OpenCart

To use multiple databases in OpenCart (1.5.*), just update 3 files as given below:

  1. Config.php:
    Add:

     //New DB

    define(‘NEWDB_DRIVER’, ‘mysql’);
    define(‘NEWDB_HOSTNAME’, ‘localhost’);
    define(‘NEWDB_USERNAME’, ‘root’);
    define(‘NEWDB_PASSWORD’, ‘password’);
    define(‘NEWDB_DATABASE’, ‘sitename_newdb’);
    define(‘NEWDB_PREFIX’, ‘ndb’);
  2. Index.php:
    Below the current database setup ($db = new DB(DB_DRIVER …) add:

     $newdb = new DB(NEWDB_DRIVER, NEWDB_HOSTNAME, NEWDB_USERNAME, NEWDB_PASSWORD, NEWDB_DATABASE);

    $registry->set(‘newdb’, $newdb );
  3. system/database/mysql.php:
    Modify:

     change:

    if (!$this->link = mysql_connect($hostname, $username, $password)) {
    to:
    if (!$this->link = mysql_connect($hostname, $username, $password, true)) {

After these above steps we can access the new database by:

$this->newdb->query("SELECT * FROM ". NEWDB_PREFIX . "users");



Leave a Reply

AI Spiritual Tools & Interactive Experiences

Explore powerful AI-driven tools for daily guidance, spirituality, fun quizzes, and self-discovery.

Today’s Quote

Get inspiring daily quotes powered by AI to motivate and guide your day.

Explore Now

AI Tarot Card Reader

Reveal insights about your future, love, and career with AI tarot readings.

Read Tarot

Love Match Calculator

Check compatibility and love predictions using AI-based analysis.

Check Match

Fortune Cookie

Open an AI fortune cookie and receive wisdom, luck, and fun messages.

Open Cookie

Quiz Categories

Engage with knowledge-based and fun quizzes across multiple categories.

Start Quiz

Panchang Calendar

View daily Panchang, auspicious timings, tithi, nakshatra, and festivals.

View Panchang

Online Numerology

Discover your destiny number, life path, and numerology predictions.

Calculate Now

Spiritual Feeds

Stay connected with spiritual thoughts, mantras, and divine content.

View Feeds

Quiz Hub

Attempt trending quizzes on GK, spirituality, festivals, and more.

Explore Quizzes