prepare("UPDATE processes SET name = :name, description = :description WHERE id = :id"); $stmt->bindParam(':name', $name, PDO::PARAM_STR); $stmt->bindParam(':description', $description, PDO::PARAM_STR); $stmt->bindParam(':id', $id, PDO::PARAM_INT); if ($stmt->execute()) { header('Location: index.php?status=success&message=Process updated successfully!'); exit(); } else { header('Location: edit_process.php?id=' . $id . '&status=error&message=Failed to update process.'); exit(); } } catch (PDOException $e) { error_log("DB Error: " . $e->getMessage()); header('Location: edit_process.php?id=' . $id . '&status=error&message=Database error: ' . urlencode($e->getMessage())); exit(); } } } else { header('Location: index.php?status=error&message=Invalid request method.'); exit(); }