ok

Mini Shell

Direktori : /home2/selectio/www/wedding-info-new/api/
Upload File :
Current File : /home2/selectio/www/wedding-info-new/api/profile_edit.php

<?php
include_once('config/config.php');
session_start();

$return_arr = array(); // Initialize the return array

if ($_SERVER['REQUEST_METHOD'] === 'POST') {
    // Assuming you have sanitized the input data, if not, do it before using in the query.
    $id = $_SESSION['user']['id'];
    $intrests = $_POST['intrests'];
    $mobile = $_POST['mobile'];
    $occupation = $_POST['occupation'];
    $annual_income = $_POST['annual_income'];
    $religion = $_POST['religion'];
    $zodiac_signs_star = $_POST['zodiac_signs_star'];
    $dhosam = $_POST['dhosam'];

    // Prepare and execute the SQL statement
    $statement = $pdo->prepare("UPDATE `tbl_alliances_register` SET 
        `intrests` = ?,
        `mobile_no_alt` = ?,
        `occupation` = ?,
        `annual_incm` = ?,
        `religion` = ?,
        `h_zodic` = ?,
        `h_dosham` = ?
        WHERE `id` = ?");
    
    $result = $statement->execute([
        $intrests,
        $mobile,
        $occupation,
        $annual_income,
        $religion,
        $zodiac_signs_star,
        $dhosam,
        $id // Assuming $id contains the ID of the record you want to update
    ]);

    if ($result) {
        $return_arr['message'] = 'Profile Updated successfully.';
        $return_arr['status'] = 200;
    } else {
        $return_arr['message'] = 'Something went wrong.';
        $return_arr['status'] = 400;
    }

    echo json_encode($return_arr);
} else {
    $return_arr['message'] = 'Invalid request method.';
    $return_arr['status'] = 400;
    echo json_encode($return_arr);
}
?>

Zerion Mini Shell 1.0