Article classification added function
1, write article categories and add templates
Create a new categoryListHtml.php file, the code is as follows:
后台文章分类管理
The interface is shown as follows :
2, enter the category information to submit the form
Create a new category.php file Get the data submitted by the form, and then write the data into the database. The specific code is as follows:
data($data)->fetchRow($sql)){ $error[]="该文章分类已存在"; }else{ //插入到数据库 $sql="insert into cms_category(name)values(:name)"; $db->data($data)->query($sql); } } } } require './categoryListHtml.php';
Click to add:
##The database is displayed as follows:
Click to add and observe the database information: