File "update-profile.php"
Full path: /home/eshuaesb/public_html/www.mhawaterpark.com/api/update-profile.php
File
size: 1.22 KB B
MIME-type: text/x-php
Charset: utf-8
Download Open Edit Advanced Editor Back
<?php
include 'conn.php'; // Database Connection
$data = json_decode(file_get_contents("php://input"), true);
$mobile = $data['mobile'];
$uname = $data['uname'];
$email = $data['email'];
$city = $data['city'];
$address = $data['address'];
$pin_code = $data['pin_code'];
$aadhar = $data['aadhar'];
$pan = $data['pan'];
$bank_name = $data['bank_name'];
$branch_name = $data['branch_name'];
$account_holder = $data['account_holder'];
$account_no = $data['account_no'];
$ifsc_code = $data['ifsc_code'];
$upi_id = $data['upi_id'];
$query = "UPDATE tbl_user SET
uname = '$uname',
email = '$email',
city = '$city',
address = '$address',
pin_code = '$pin_code',
aadhar = '$aadhar',
pan = '$pan',
bank_name = '$bank_name',
branch_name = '$branch_name',
account_holder = '$account_holder',
account_no = '$account_no',
ifsc_code = '$ifsc_code',
upi_id = '$upi_id',
kyc = '1'
WHERE mobile = '$mobile'";
if (mysqli_query($conn, $query)) {
echo json_encode(["status" => "success", "message" => "Profile updated successfully"]);
} else {
echo json_encode(["status" => "error", "message" => "Failed to update profile"]);
}
mysqli_close($conn);
?>