PHP開發(fā)簡單圖書後臺管理系統(tǒng)圖書統(tǒng)計完整程式碼
引入資料庫檔案config.php檔案
和判斷管理員是否登入的ly_check.php檔案
在HTML頁面中呼叫css.css樣式
把圖書統(tǒng)計頁面命名為count.php檔案。
<?php include("config.php"); require_once('ly_check.php'); ?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>圖書統(tǒng)計</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"> 后臺管理 >> 圖書統(tǒng)計</td> </tr> <tr> <td align="center" bgcolor="#FFFFFF" height="27">圖書類別</td> <td align="center" bgcolor="#FFFFFF">庫內(nèi)圖書</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>
這樣,我們的完整的簡單圖書後臺管理系統(tǒng)就基本完成了,希望透過完成這個系統(tǒng)
對大家的PHP學(xué)習(xí)有一定的幫助。
註解:本教學(xué)程式碼僅供朋友學(xué)習(xí)與參考,不可用於專案!
#