update
This commit is contained in:
parent
242feb39ba
commit
828df3f622
13
core/db.php
Normal file
13
core/db.php
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<?php
|
||||||
|
$host = '1Panel-mysql-x'; // 数据库地址
|
||||||
|
$db = ''; // 数据库名
|
||||||
|
$user = ''; // 数据库用户名
|
||||||
|
$pass = ''; // 数据库密码
|
||||||
|
|
||||||
|
try {
|
||||||
|
$pdo = new PDO("mysql:host=$host;dbname=$db", $user, $pass);
|
||||||
|
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||||
|
} catch (PDOException $e) {
|
||||||
|
echo "Connection failed: " . $e->getMessage();
|
||||||
|
}
|
||||||
|
?>
|
Loading…
Reference in New Issue
Block a user