prepare($query); $stmt->bindParam(':fineamount', $fineamount); $stmt->bindParam(':finedate', $finedate); $stmt->bindParam(':status', $status); $stmt->bindParam(':loanid', $loanid); // Execute the query $stmt->execute(); echo json_encode(['success' => true, 'message' => 'Fine issued successfully!']); } catch (PDOException $e) { echo json_encode(['success' => false, 'message' => 'Error: ' . $e->getMessage()]); } } ?>