When I run the code below it does work
$sql = "SELECT * FROM `be_22122020` WHERE 1";
$result = $conn->query($sql);
while($row = $result->fetch_assoc()) {
echo "id: " . $row["code"]. " - Name: " . $row["airport_name"]. " " . $row["country_code"]."<br>";
}
But when I change the MYSQL query into the code below the pages shows an
AH01071: Got error 'PHP message: PHP Fatal error: Uncaught Error: Call to a member function fetch_assoc() on bool
$sql = "SELECT `code`, `airport_name`, `country_code` FROM `be_22122020` WHERE code =
\'JFK\'";
The MYSQL query is copied from phpMyAdmin and is should work. How can I fix this error so it echo's the correct values?