<?php
$replica_servername = "localhost"; // Change to replica server address when available
$replica_username = "homecar1_root";
$replica_password = "2021wemadeit";
$replica_dbname = "homecar1_med";

// Create replica connection
$replica_conn = new mysqli($replica_servername, $replica_username, $replica_password, $replica_dbname);

// Check connection
if ($replica_conn->connect_error) {
    error_log("Replica connection failed: " . $replica_conn->connect_error);
    // Fallback to primary if replica fails
    $replica_conn = null;
}
?>