index.php 파일 내용
-----------------------------------------------------------------------------
<?
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<h1></h1>
<?php
//mysql 접속 계정 정보 설정
$mysql_host = 'localhost';
$mysql_user = 'root';
$mysql_password = 'root';
$mysql_db = 'db';
//connetc 설정(host,user,password)
$conn = mysql_connect($mysql_host,$mysql_user,$mysql_password);
//db 연결
$dbconn = mysql_select_db($mysql_db,$conn);
//charset UTF8
mysql_query("set names utf8");
//쿼리문 작성
$query = "select * from log";
//쿼리보내고 결과를 변수에 저장
$result = mysql_query($query);
echo "MySQL에서 가져온 데이터는 아래와 같습니다.<br/>";
while($row = mysql_fetch_array($result)){
echo "번호: ".$row[id]."/ 시간: ".$row[time]."<br/>";
}
?>
</body>
</html>
https://1sam.kr/xe_tips/54115
저도 예전에 이 팁을 보고 도움을 받았었는데요.
$grant = Context::get('grant'); 로 정의하면
$grant->manager가 true일 때로 해서 관리자한테만 출력부분을 노출시킬 수 있을 것 같습니다.