/
/
home
/
u523034047
/
domains
/
gmcrudrapur.com
/
public_html
/
admin
Server: in-mum-web1112.main-hosting.eu (62.72.28.111)
You: 216.73.216.4
PHP 8.3.16
Dir:
/home/u523034047/domains/gmcrudrapur.com/public_html/admin
Edit:
/home/u523034047/domains/gmcrudrapur.com/public_html/admin/get_images_by_category.php
<?php include("conn.php"); if (!isset($_GET['cat_id']) || !is_numeric($_GET['cat_id'])) { echo "<p>Invalid Category ID.</p>"; exit; } $cat_id = intval($_GET['cat_id']); $sql = "SELECT * FROM itemimg WHERE categoriesid = $cat_id"; $query = mysqli_query($connection, $sql); $count = 1; if (mysqli_num_rows($query) > 0) { echo '<table class="table table-bordered table-striped"> <thead> <tr> <th>#</th> <th>Image</th> <th>Action</th> </tr> </thead><tbody>'; while ($row = mysqli_fetch_array($query)) { echo '<tr> <td>' . $count++ . '</td> <td><img src="itemimages/' . $row['image'] . '" height="50" width="50"></td> <td><a href="itemdelete.php?id=' . $row['id'] . '" onclick="return confirm(\'Delete this image?\')">Delete</a></td> </tr>'; } echo '</tbody></table>'; } else { echo "<p>No images found for this category.</p>"; } ?>
Ukuran: 1.0 KB