adding username to get_posts api response
This commit is contained in:
parent
1c28030ba2
commit
435dcb3088
@ -28,6 +28,15 @@ while (($res = $out -> fetch_assoc()))
|
||||
$buffer_array[$key] = $value;
|
||||
}
|
||||
|
||||
$author_buffer = $database -> query("SELECT username FROM user WHERE id=" . $value);
|
||||
if ($author_buffer -> num_rows == 1)
|
||||
{
|
||||
$buffer_array["username"] = ($author_buffer -> fetch_assoc())["username"];
|
||||
} else
|
||||
{
|
||||
$buffer_array["username"] = "[odstraněn]";
|
||||
}
|
||||
|
||||
array_push($output, $buffer_array);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user