Created
December 21, 2020 15:26
-
-
Save AlphaRomeoMike/3bf42e2ccc2928fbedee9555a23ae399 to your computer and use it in GitHub Desktop.
Insert file 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")); | |
$name = $data->name; | |
$age = $data->age; | |
$phone = $data->phone; | |
$query = "CALL st_insertUser('$name', $age, '$phone')"; | |
if(mysqli_query($con, $query)) { | |
$response["msg"] = "User added successfully"; | |
} else { | |
$response["msg"] = "Add user 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