connect_error) { die("Connection failed: " . $conn->connect_error); } // Handle form submission if ($_SERVER["REQUEST_METHOD"] == "POST") { $client_id = $_POST['client_id']; $category_id = $_POST['category_id']; $subject = $_POST['subject']; $description = $_POST['description']; $priority = $_POST['priority']; $assigned_staff_id = $_POST['assigned_staff_id']; $sql = "INSERT INTO tickets (client_id, category_id, subject, description, priority, assigned_staff_id) VALUES (?, ?, ?, ?, ?, ?)"; $stmt = $conn->prepare($sql); $stmt->bind_param("iisssi", $client_id, $category_id, $subject, $description, $priority, $assigned_staff_id); if ($stmt->execute()) { echo "
Ticket added successfully!
"; } else { echo "Error: " . $stmt->error . "
"; } } ?>