This repository has been archived on 2026-06-20. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
carwash_order/db_connect.php
T
wsh5485 0fadca8ca0 feat: 初始化洗车预约系统基础框架
添加系统核心文件包括数据库配置、连接、SQL脚本、前端页面和样式
实现预约提交、管理功能及移动端优化
包含完整的README文档说明系统功能和使用方法
2025-11-19 00:42:09 +08:00

12 lines
399 B
PHP

<?php
// db_connect.php - 数据库连接文件
require_once 'config.php';
try {
$pdo = new PDO("mysql:host=$host;dbname=$database;charset=utf8", $username, $password);
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$pdo->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC);
} catch(PDOException $e) {
die("数据库连接失败: " . $e->getMessage());
}
?>