I want to load and display date form mysql, but program show me an error.

**Error**

> 
> Fatal error: Uncaught Error: Call to a member function fetch\_assoc()
> on bool in C:\xampp\htdocs\quiz\index1.php:20 Stack trace: #0 {main}
> thrown in C:\xampp\htdocs\quiz\index1.php on line 20
> 
> 
> 

**Code**

```
<?php
   require_once "connect1.php";

   $polaczenie = @new mysqli($host, $db_user, $db_password, $db_name);

   if($polaczenie->connect_errno!=0)
   {
      echo "Error".$polaczenie->connect1_errno. " Opis: ". $polaczenie->connect1_error;
   } else {
      $sql = "SELECT tresc FROM quiz";
      $result = $polaczenie->query($sql);
      while($record = $result->fetch_assoc())
      {
        echo $record['tresc'];
      }
   }
?>

```