mysql select 로 자료 출력

https://youtu.be/DVSNmk4E2EE

 

 

 

<?php include "database.php"; ?>

<?php

  //Create Select Query

  $query = "SELECT * FROM shout";

  $shouts = mysqli_query($con, $query);

?>

<!DOCTYPE html>

<html>

  <head>

    <meta charset="utf-8">

    <title>Talk and Talk</title>

    <link rel="stylesheet" href="css/style.css" type="text/css" />

  </head>

  <body>

    <div id="container">

      <header>

        <h1>Talk And Talk</h1>

      </header>

      <div id="shouts">

        <ul>

          <?php while($row = mysqli_fetch_assoc($shouts)) : ?>

              <li class="shout"><span><?php echo $row['time'] ?> - </span><strong><?php echo $row['user'] ?>:</strong> <?php echo $row['message'] ?></li>

          <? endwhile; ?>

        </ul>

      </div>

      <div id="input">

        <form action="precess.php" method="post">

          <input type="text" name="user" placeholder="이름을 입력하세요" />

          <input type="text" name="message" placeholder="메세지를 입력하세요" />

          <br />

          <input class="shout-btn" type="submit" name="submit" value="글쓰기">

        </form>

      </div>

    </div>

  </body>

</html>


|

댓글 1개

어떻게 동작하는지 보여지니깐 이해가 쉽네요.
댓글을 작성하시려면 로그인이 필요합니다. 로그인

호스팅정보

+
제목 글쓴이 날짜 조회
10년 전 조회 807
10년 전 조회 682
10년 전 조회 797
10년 전 조회 834
10년 전 조회 1,377
10년 전 조회 885
10년 전 조회 776
10년 전 조회 730
10년 전 조회 745
10년 전 조회 749
10년 전 조회 758
10년 전 조회 804
10년 전 조회 738
10년 전 조회 985
10년 전 조회 672
10년 전 조회 629
10년 전 조회 792
10년 전 조회 709
10년 전 조회 819
10년 전 조회 942
10년 전 조회 755
10년 전 조회 824
10년 전 조회 796
10년 전 조회 619
10년 전 조회 713
10년 전 조회 841
10년 전 조회 605
10년 전 조회 988
10년 전 조회 651
10년 전 조회 680
🐛 버그신고