I have an error and I do not understand why. The error:
Fatal error: Call to a member function fetch_assoc() on boolean
the error snippet:
require 'conecta.php';
$sql = "SELECT 'nomep', 'endereco' FROM 'cadastropn' WHERE 'cidade' = Caxias do Sul";
$result = mysqli_query($mysqli, $sql);
while($linha = $result->fetch_assoc()) {
echo '<article>' . $linha['nomep'];
$nome = $linha['nomep'];
echo '</article>';
}
The strange thing is that the error only happens when I put WHERE
city = Caxias do Sul";