forked from niqietingfengyin/bookstore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cate_browser.php
41 lines (40 loc) · 1.14 KB
/
cate_browser.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<html>
<head>
<title>categorybrowser</title>
</head>
<body>
<p> </p>
<p> </p>
<center>
<table width="80%" border="1" cellspacing="1" cellpadding="1">
<tr>
<td align="center"><b>Category ID</B></td>
<td align=center><b>Name</B></td>
<td align=center><b>Description</b></td>
<td align=center><b>Parent Category</b></td>
<td align=center><b>Products</b></td>
<td> </td>
</tr>
<?php
$conn=mysql_connect("localhost","root","101389");
$db=mysql_select_db("books")or die("connect with database failed".mysql_error());
$sql="select * from category";
$result=mysql_query($sql)or die("failed".mysql_error());
while($row=mysql_fetch_array($result))
{
echo "<tr><td>".$row["categoryid"]."</td>";
echo "<td>".$row["name"]."</td>";
echo "<td>".$row["description"]."</td>";
echo "<td>".$row["parentcategoryid"]."</td>";
echo "<td><a href=\"catprobrowser.php?categorynum=".$row["categoryid"]."\">Products</a></td>";
echo "<td><a href=\"dcategory.php?categorynum=".$row["categoryid"]."\">delete</a></td></tr>";
}
?>
</table>
<center>
<p> </p>
<p>Return to Admin Page</p>
<p><a href="admin.php">Click Here!</a></p>
</center>
</body>
</html>