<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                # 1.新建data_v3/v1/index_1.php文件 ~~~ <?php /** * Email:y7wanghui@gmail.com * Date: 2020/11/2 0002 */ // 計算出數據庫的路徑,以便SQLite / PDO可以連接 $root = __DIR__; $database = $root . '/../data/data.sqlite'; $dsn = 'sqlite:' . $database; // 計算出數據庫的路徑,以便SQLite / PDO可以連接 $pdo = new PDO($dsn); $stmt = $pdo->query( 'SELECT title, created_at, body FROM post ORDER BY created_at DESC' ); if ($stmt === false) { throw new Exception('運行此查詢時出現問題'); } ?> <!DOCTYPE html> <html> <head> <title>我的博客</title> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> </head> <body> <h1>標題</h1> <?php while ($row = $stmt->fetch(PDO::FETCH_ASSOC)): ?> <h2> <?php echo htmlspecialchars($row['title'], ENT_HTML5, 'UTF-8') ?> </h2> <div> <?php echo $row['created_at'] ?> </div> <p> <?php echo htmlspecialchars($row['body'], ENT_HTML5, 'UTF-8') ?> </p> <p> <a href="#">Read more...</a> </p> <?php endwhile ?> </body> </html> ~~~ # 2.重寫index_1.php為index.php 使得 Read more...可點擊 ~~~ 修改<a href="#">Read more...</a> 為<a href="view-post.php?post_id=<?php echo $row['id']?>">Read more...</a> 我們只需要跳轉并傳參id到view-post.php即可 ~~~ .
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看