duelfi_api/get_user_by_id.php
2025-04-11 05:02:06 +08:00

16 lines
371 B
PHP

<?php
include('connection.php');
include('data_grabber.php');
$id = $_GET['id'];
$conn = OpenCon();
$selectSql = "SELECT * FROM Users WHERE id='$id'";
$selectQuery = mysqli_query($conn, $selectSql);
if(mysqli_num_rows($selectQuery) > 0){
echo json_encode(mysqli_fetch_assoc($selectQuery));
}else{
echo "0";
}
?>