Skip to content

Instantly share code, notes, and snippets.

@AlphaRomeoMike
Created December 21, 2020 15:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AlphaRomeoMike/0ef60bd2a425b7fb94b205474926e1f7 to your computer and use it in GitHub Desktop.
Save AlphaRomeoMike/0ef60bd2a425b7fb94b205474926e1f7 to your computer and use it in GitHub Desktop.
Select for API
<?php
require "connection.php";
$query = "CALL st_getUser()";
$response = array();
$res = mysqli_query($con, $query);
if(mysqli_num_rows($res)) {
while($row = mysqli_fetch_assoc($res)) {
$response[] = $row;
}
} else {
$response["msg"] = "No records";
}
echo json_encode($response);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment