기본 db출력

HSGemini·2022년 3월 10일
0

공부

목록 보기
3/3

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>

<?php

require_once('db.php');
$db = new MysqliDb('localhost','root','1234','board');
$list = $db->get('board');
print_r($list);


//unset($data);
//$data[name] = "홍길동";
/*$data = Array ("name" => "admin",
               "pw" => "1234",
               "subject" => "Doe",
               "content" => "ww",
               "date" => date("Y-m-d H:i:s"),
               "phone" => "010-8888-8888",
               "email" => "hhh@gmail.com"
);
*/
//$id = $db->insert ('board', $data);
//if($id)
 //   echo 'user was created. Id=' . $id;

?>

<table border=1>
    <tr>
        <th>idx</th>
        <th>이름</th>
        <th>제목</th>
        <th>본문</th>
        <th>날짜</th>
        <th>핸드폰</th>
        <th>이메일</th>
    </tr>
    <?foreach($list as $data){ ?>
    <tr>
        <th><?=$data['idx']?></th>
        <th><?=$data['name']?></th>
        <th><?=$data['subject']?></th>
        <th><?=$data['content']?></th>
        <th><?=$data['date']?></th>
        <th><?=$data['phone']?></th>
        <th><?=$data['email']?></th>
    </tr>
    <? } ?>

</table>


</body>
</html>

profile
공부중

0개의 댓글