prepare('SELECT * FROM products WHERE id = ?'); $stmt->execute([$id]); $product = $stmt->fetch(); if (!$product) { // Redirect or show an error header('Location: products.php'); exit; } ?>