prepare($sql); $stmt->execute(); if ($stmt->rowCount() > 0) { // Fetch the record $row = $stmt->fetchAll(PDO::FETCH_ASSOC); $count = $stmt->rowCount(); // $response = array( // "message" => "Payment data saved successfully", // "id" => "0", // "count" => $count, // "data" => $rows // ); // echo json_encode($response); jsonSuccess($row); } else{ // Print a failure message jsonError($message = "No wallet record found"); } ?>