D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
thread-self
/
root
/
home
/
markniuj
/
bazmeasar.com
/
admin
/
Filename :
all-categories.php
back
Copy
<?php include "../config.php"; ?> <!DOCTYPE html> <html> <head> <title>Category Management</title> <!-- responsive meta --> <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- For IE --> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <!-- Module css --> <link rel="stylesheet" href="css.css"> </head> <body> <h1>Category Management</h1> <?php // Query to retrieve categories from the "categories" table $query = "SELECT catid, catname FROM categories"; $result = $conn->query($query); if ($result->num_rows > 0) { echo "<table border='1'>"; echo "<tr><th>Category ID</th><th>Category Name</th><th>Edit</th><th>Delete</th></tr>"; while ($row = $result->fetch_assoc()) { $catid = $row["catid"]; $catname = $row["catname"]; echo "<tr>"; echo "<td>$catid</td>"; echo "<td>$catname</td>"; echo "<td><a href='edit_category.php?catid=$catid'>Edit</a></td>"; echo "<td><a href='delete_category.php?catid=$catid'>Delete</a></td>"; echo "</tr>"; } echo "</table>"; } else { echo "No categories found."; } $conn->close(); ?> </body> </html>