Database 연결을 localhost 에서 192.168.2.166 으로 변경

This commit is contained in:
Hyojin Ahn 2025-10-21 10:39:23 -04:00
parent f68db6c7f2
commit d639a9dbec
2 changed files with 4 additions and 3 deletions

View File

@ -3,7 +3,8 @@
date_default_timezone_set('America/Toronto');
if ($_SERVER["REMOTE_ADDR"] == "127.0.0.1" || $_SERVER["REMOTE_ADDR"] == "::1" || str_contains($_SERVER["HTTP_HOST"], "localhost")) {
$host = "localhost";
// $host = "localhost";
$host = "192.168.2.166";
$user = "goiintra_root";
$pw = "L0C2CKN5GHHY";
$dbName = "goiintra_db";

View File

@ -1,12 +1,12 @@
<?php
if ($_SERVER["REMOTE_ADDR"] == "127.0.0.1" || $_SERVER["REMOTE_ADDR"] == "::1" || str_contains($_SERVER["HTTP_HOST"], "localhost")) {
$DB_HOST = "localhost";
$DB_HOST = "192.168.2.166";
$DB_NAME = "goiintra_db";
$DB_USER = "goiintra_root";
$DB_PASSWORD = "L0C2CKN5GHHY";
if ($pdo = new PDO('mysql:host=localhost;dbname=goiintra_db', $DB_USER, $DB_PASSWORD))
if ($pdo = new PDO('mysql:host=192.168.2.166;dbname=goiintra_db', $DB_USER, $DB_PASSWORD))
{echo "";}else{echo "bad news";}
}