I have following code to retrieve information of user:
function getUserProfile($id) {
$sql_query_profile="SELECT * FROM users WHERE id=$id";
$user_profile=@mysqli_query($dbconfig,$sql_query_profile);
$user_details_profile=@mysqli_fetch_array($user_profile,MYSQLI_ASSOC);
return $user_details_profile;
}
when I call this function, it returns null value.
$user= getUserProfile($_POST['txt_id']);
var_dump ($user);
can anybody suggest the better idea please?