上传文件至 /
This commit is contained in:
21
db_config.php
Normal file
21
db_config.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
// 数据库配置
|
||||
$host = 'localhost';
|
||||
$db = 'a1sax1m9i';
|
||||
$user = 'a1sax1m9i';
|
||||
$pass = 'a1sax1m9i';
|
||||
$charset = 'utf8mb4';
|
||||
|
||||
$dsn = "mysql:host=$host;dbname=$db;charset=$charset";
|
||||
$options = [
|
||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
||||
PDO::ATTR_EMULATE_PREPARES => false,
|
||||
];
|
||||
|
||||
try {
|
||||
$conn = new PDO($dsn, $user, $pass, $options);
|
||||
} catch (\PDOException $e) {
|
||||
throw new \PDOException($e->getMessage(), (int)$e->getCode());
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user