<?php
// 数据库配置
define('DB_HOST', 'localhost');
define('DB_USER', '数据库名称');
define('DB_PASS', '数据库密码');
define('DB_NAME', '数据库名字');

function getDBConnection() {
    $conn = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);
    if ($conn->connect_error) {
        die("连接失败: " . $conn->connect_error);
    }
    return $conn;
}