99999999.99) { printFailure("Invalid tip amount."); exit(); } // Assuming your `created_at` column is of type TIMESTAMP and has the default value CURRENT_TIMESTAMP $sql = "INSERT INTO `tips`(`id`, `driverID`, `passengerID`, `rideID`, `tipAmount`) VALUES (null, :driverID, :passengerID, :rideID, :tipAmount)"; $stmt = $con->prepare($sql); // Bind parameters to prevent SQL injection $stmt->bindParam(':driverID', $driverID); $stmt->bindParam(':passengerID', $passengerID); $stmt->bindParam(':rideID', $rideID); $stmt->bindParam(':tipAmount', $tipAmount); $stmt->execute(); if ($stmt->rowCount() > 0) { // Print a success message printSuccess($message = 'Tip inserted successfully'); } else { // Print a failure message printFailure($message = "Failed to save tip information"); } ?>