Created
December 21, 2020 15:29
-
-
Save AlphaRomeoMike/270bbcbab029589e8233f7e9a3209185 to your computer and use it in GitHub Desktop.
Update for API
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require "connection.php"; | |
$data = json_decode(file_get_contents("php://input")); | |
$id = $data->id; | |
$name = $data->name; | |
$age = $data->age; | |
$phone = $data->phone; | |
$query = "CALL st_updateUser('$name', $age, '$phone', $id)"; | |
if(mysqli_query($con, $query)) { | |
$response["msg"] = "User update response from server was a success "; | |
} else { | |
$response["msg"] = "User update response from server failed"; | |
} | |
echo json_encode($response); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment