List display

After adding data to the database, we then want to display the data in the database on our front page. This is our display function.

First of all, if we want to display the data in the database, we need to connect to our database. As mentioned before, there will be many places where the database connection code is used. It will be very troublesome to write it every time. , we re-create a file, write the connection database into it, and then call it.

Name the new file config.php, just quote it directly

The next step is to query the data from the database and display the found data on the front-end page .

Find the data from the list data table, and then display it on the front-end page. Let's take a look at the front-end file.

      首页  2016-07-01    

We only need to display the queried data in a loop on the front-end page.

We assign the queried value to $row in the form of an array and loop it out through the while loop. Loop out in the corresponding place on the front-end page in the form of . In this way, our display page is completed.

We will talk about paging and keyword search in the next section.

Continuing Learning
||
内容列表 添加字段
submit Reset Code
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!
ID 作者 图片 内容 评论 分类名称 发布时间 操作
首页 2016-07-01