PHP develops simple book background management system book statistics complete code
Introduce the database file config.php file
and the ly_check.php file that determines whether the administrator is logged in
Call the css.css style in the HTML page
Place the book The statistics page is named count.php file.
<?php
include("config.php");
require_once('ly_check.php');
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>图书统计</title>
<link rel="stylesheet" href="css.css" type="text/css">
</head>
<body>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC" class="table">
<tr>
<td height="27" colspan="2" align="left" bgcolor="#FFFFFF" class="bg_tr"> 后台管理 >> 图书统计</td>
</tr>
<tr>
<td align="center" bgcolor="#FFFFFF" height="27">图书类别</td>
<td align="center" bgcolor="#FFFFFF">库内图书</td>
</tr>
<?php
$sql="select type, count(*) from yx_books group by type";
$val=mysqli_query($link,$sql);
while($arr=mysqli_fetch_row($val)){
echo "<tr height='30'>";
echo "<td align='center' bgcolor='#FFFFFF'>".$arr[0]."</td>";
echo "<td align='center' bgcolor='#FFFFFF'>本类目共有:".$arr[1]." 种</td>";
echo "</tr>";
}
?>
</table>
</body>
</html>In this way, our complete simple book backend management system is basically completed. We hope that completing this system
will be of some help to everyone's PHP learning.
Note: The code in this tutorial is only for friends to learn and refer to, and cannot be used for projects!
new file
<?php
include("config.php");
require_once('ly_check.php');
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>图书统计</title>
<link rel="stylesheet" href="css.css" type="text/css">
</head>
<body>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC" class="table">
<tr>
<td height="27" colspan="2" align="left" bgcolor="#FFFFFF" class="bg_tr"> 后台管理 >> 图书统计</td>
</tr>
<tr>
<td align="center" bgcolor="#FFFFFF" height="27">图书类别</td>
<td align="center" bgcolor="#FFFFFF">库内图书</td>
</tr>
<?php
$sql="select type, count(*) from yx_books group by type";
$val=mysqli_query($link,$sql);
while($arr=mysqli_fetch_row($val)){
echo "<tr height='30'>";
echo "<td align='center' bgcolor='#FFFFFF'>".$arr[0]."</td>";
echo "<td align='center' bgcolor='#FFFFFF'>本类目共有:".$arr[1]." 种</td>";
echo "</tr>";
}
?>
</table>
</body>
</html>
Preview
Clear
- Course Recommendations
- Courseware download
The courseware is not available for download at the moment. The staff is currently organizing it. Please pay more attention to this course in the future~
Students who have watched this course are also learning
Let's briefly talk about starting a business in PHP
Quick introduction to web front-end development
Large-scale practical Tianlongbabu development of Mini version MVC framework imitating the encyclopedia website of embarrassing things
Getting Started with PHP Practical Development: PHP Quick Creation [Small Business Forum]
Login verification and classic message board
Computer network knowledge collection
Quick Start Node.JS Full Version
The front-end course that understands you best: HTML5/CSS3/ES6/NPM/Vue/...[Original]
Write your own PHP MVC framework (40 chapters in depth/big details/must read for newbies to advance)
















