feat(web): db port

This commit is contained in:
Baoshuo Ren 2022-03-20 12:55:01 +08:00
parent 8cf76566cb
commit 4957f3aaea
Signed by: baoshuo
GPG Key ID: 00CB9680AB29F51A
2 changed files with 4 additions and 3 deletions

View File

@ -12,7 +12,8 @@ return [
'database' => 'app_uoj233',
'username' => 'root',
'password' => '_database_password_',
'host' => '127.0.0.1'
'host' => '127.0.0.1',
'port' => '3306',
],
'web' => [
'domain' => null,

View File

@ -3,7 +3,7 @@
class DB {
public static function init() {
global $uojMySQL;
@$uojMySQL = mysqli_connect(UOJConfig::$data['database']['host'] . ':3306', UOJConfig::$data['database']['username'], UOJConfig::$data['database']['password'], UOJConfig::$data['database']['database']);
@$uojMySQL = mysqli_connect(UOJConfig::$data['database']['host'] . ':' . UOJConfig::$data['database']['port'], UOJConfig::$data['database']['username'], UOJConfig::$data['database']['password'], UOJConfig::$data['database']['database']);
if (!$uojMySQL) {
echo 'There is something wrong with database >_<.... ' . mysqli_connect_error();
die();