Exemple #1
0
        $td = $_POST['noiDung'];
        $sql = "select * from baiViet";
        $bthuoc->query($sql);
    }
}
?>
<table width="820" height="121" border="1" align="center">
  <tr>
    <td width="56">Mã bài viết</td>
    <td width="125">Tên bài viết</td>
    <td width="110">Nội dung</td>
  </tr>
 
  <?php 
$data = array();
while ($row = $bthuoc->fetch()) {
    $data[] = $row;
}
foreach ($data as $rows) {
    ?>
  <tr>
    <td><?php 
    echo $rows['maBaiViet'];
    ?>
</td>
    <td><?php 
    echo $rows['tenBaiViet'];
    ?>
</td>
    <td><?php 
    echo $rows['noiDung'];
Exemple #2
0
                            <?php 
}
?>
                        </tr>
                    </table>
                </div>
                <li><a href="baiviet.php">CÁC BÀI VIẾT KHÁC</a></li><div class="nav-content" id="baiviet-newest">
                    <table class="no-border">
                        <tr class="tr-header no-border">
                            <td class="left-header-td no-border"><b>CÁC BÀI VIẾT MỚI NHẤT</b></td>
                            <?php 
$bthuoc3 = new bthuoc();
$sql5 = "SELECT * FROM baiviet ORDER BY maBaiViet DESC LIMIT 4";
$bthuoc3->query($sql5);
$data6 = array();
while ($row6 = $bthuoc3->fetch()) {
    $data6[] = $row6;
}
foreach ($data6 as $rows6) {
    ?>
                            <td class="no-border"><center><?php 
    echo "<a href='chitietbaiviet.php?maBaiViet=" . $rows6['maBaiViet'] . "'>";
    ?>
<div class="news-detail">
                                    <div class="news-detail-content"><?php 
    echo "<img src='" . $rows6['anhMinhHoa'] . "' alt='Vui lòng kết nối Internet để xem ảnh'>";
    ?>
</div>
                                    <div class="news-detail-title"><?php 
    echo $rows6['tenBaiViet'];
    ?>