国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

Article classification display function

1. Write a display article classification page:

First, you need to query the cms_category data table and add the following code to category.php:

<?php
$sql='select id,name,sort from cms_category order by sort';
$category=$db->fetchAll($sql);

Modify the categoryListHtml.php page

Add the code as follows:

<?php
<!--展示文章分類功能-->
    <table border="1" cellpadding="3" cellspacing="0" width="20%">
        <tr bgcolor="skyblue">
            <td align="center">排序</td>
            <td>分類名稱</td>
            <td align="center">操作</td>
        </tr>
        //遍歷展示分類信息
        <?php foreach ($category as $v):?>
            <tr>
                <td><input type="text" name="<?php echo $v['id'];?>" value="<?php echo $v['sort'];?>"></td>
                <td><?php echo $v['name'];?></td>
                <td><a href="#">刪除</a>|<a href="">編輯</a> </td>
            </tr>
        <?php endforeach;?>
    </table>

2, introduce and add error message

require './header.php';

3, Refresh the page display

微信圖片_20180306153340.png

##4, Click to add page effect display

If you don’t want to write data, click to add as follows:

gif5新文件 (1).gif

To write data, click to add as follows:

gif5新文件 (2).gif

Continuing Learning
||
<?php echo "文章分類顯示功能";
submitReset Code