prepare("INSERT INTO process_events (processInstanceId, eventType, description, createdBy) VALUES (?, ?, ?, ?)"); $stmt->execute([$instanceId, $eventType, $description, $userId]); // Update the last activity time for the instance $stmt_update = $pdo->prepare("UPDATE process_instances SET lastActivityAt = NOW() WHERE id = ?"); $stmt_update->execute([$instanceId]); // Redirect back to the dashboard header("Location: process_dashboard.php"); exit;