I run this code but it cause the error => Uncaught Error: Call to a member function fetch_assoc() on boolean in C:\XAMPP\htdocs\Test1\getCity.php , I really don't know why I had seen other solutions in the site but I didn't have a solution yet
my php code is like that :
case'getfriend':
$namme = $_GET['name'];
$sql = "SELECT name FROM user WHERE name =".$namme;
$result = $conn->query($sql);
$res['friend'] = [] ;
while($row = $result->fetch_assoc()){
$res['friend'][] = $row ;
}
echo json_encode($res);
break ;