Что не так с моим кодом?
$stmt = $db->prepare("SELECT * FROM allfriend WHERE friendOf = ?");
$stmt->bind_param('s', $userId);
if($stmt->execute()){
$result = $stmt->get_result();
while ($obj = $result->fetch_object()) {
$result[] = $obj;
}
echo json_encode($result);
}
Подробнее здесь: https://stackoverflow.com/questions/235 ... t-as-array
Мобильная версия