dbconfig.txt 에서 localhost 가져오면 에러납니다. 채택완료
스노든
8년 전
조회 1,772
dbconfig.txt 첫째줄에 localhost를 저장하였습니다.
그리고 config.php 파일에서 불러왔는데 자꾸 에러가 납니다.
뭔가 기본적인 문법에러 같은데 뭔지 도통 모르겠네요.
$file = 'dbconfig.txt';
$current = file($file);
echo $current[0].'
';
echo $current[1].'
';
echo $current[2].'
';
if(isset($current[3])){
$pass = $current[3];
echo $current[3].'
';
} else {
$pass = '';
echo '
';
};
$conn = mysqli_connect($current[0], 'root', '', 'porche');
?>
댓글을 작성하려면 로그인이 필요합니다.
답변 1개
답변을 작성하려면 로그인이 필요합니다.
로그인