Skip to content

데이터베이스 mysql 실습 에러 입니다  #142

Description

@chung0906

증상

<?php
   $conn = mysqli_connect("localhost", "root", 111111);
   mysqli_select_db($conn,'opentutorials');
   $result = mysqli_query($conn, "SELECT * FORM topic");
   $row = mysqli_fetch_assoc($result);

echo "<br/>";
   
   echo $row('id');
   echo $row('title');
 ?>

위와 같이 코드를 작성했을때 아래와 같이 에러 메세지가 뜹니다.

Warning: mysqli_connect(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: YES) in C:\Bitnami\wampstack-7.1.12-0\apache2\htdocs\php\index.php on line 2

Warning: mysqli_select_db() expects parameter 1 to be mysqli, boolean given in C:\Bitnami\wampstack-7.1.12-0\apache2\htdocs\php\index.php on line 3

Warning: mysqli_query() expects parameter 1 to be mysqli, boolean given in C:\Bitnami\wampstack-7.1.12-0\apache2\htdocs\php\index.php on line 4

Warning: mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, null given in C:\Bitnami\wampstack-7.1.12-0\apache2\htdocs\php\index.php on line 5

Fatal error: Uncaught Error: Function name must be a string in C:\Bitnami\wampstack-7.1.12-0\apache2\htdocs\php\index.php:9 Stack trace: #0 {main} thrown in C:\Bitnami\wampstack-7.1.12-0\apache2\htdocs\php\index.php on line 9

확인 부탁드립니다.

환경

윈도우10, 크롬 입니다.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions