```php prepare("INSERT INTO products (name, description, image_path, affiliate_url) VALUES (?, ?, ?, ?)"); $stmt->execute([$name, $description, $targetPath, $affiliate_url]); $message = 'Product added successfully!'; } else { $error = 'Failed to upload image'; } } else { $error = 'Please select an image'; } } // Get all products for listing $products = $pdo->query("SELECT * FROM products ORDER BY created_at DESC")->fetchAll(PDO::FETCH_ASSOC); ?>
= htmlspecialchars($product['description']) ?>