 <div class="form-group">
                    <h3>Edit Product</h3><br>
                    <div class="input-group">
                        <!-- Category Select Box -->
                        <select class="btn btn-outline-secondary dropdown-toggle dropdown-toggle-split" name="category" required>
                            <option value="">Select Category</option>
                            <?php
                            if ($category_result->num_rows > 0) {
                                while ($category_row = $category_result->fetch_assoc()) {
                                    $category = htmlspecialchars($category_row["category"]);
                                    $selected = (trim($category) === trim($row['category'])) ? ' selected' : '';
                                    echo '<option value="' . $category . '"' . $selected . '>' . $category . '</option>';
                                }
                            } else {
                                echo '<option value="">No categories available</option>';
                            }
                            ?>
                        </select>

                        <!-- Product Input Field -->
                        <input type="text" class="form-control" placeholder="Add Product" aria-label="Text input with segmented dropdown button" name="product" value="<?php echo htmlspecialchars($row['product'] ?? ''); ?>" required>
                    </div>
                </div>