'How to disable Warning: mysqli_result::fetch_array(): Couldn't fetch mysqli_result [duplicate]

For my PHP I get a warning message:

Warning: mysqli_result::fetch_array(): Couldn't fetch mysqli_result in /var/www/scorebord/loader.php on line 11

 <?php
//header("Refresh: 60; URL=loader.php");

  $db = new mysqli('localhost','root','wortel','score');
 if(mysqli_connect_errno()){
         echo mysqli_connect_error();
        }

 $result = $db->query("SELECT code FROM score.dash where id=1");
 
  while ($row = $result->fetch_array())
 {
                                    
                           
                           switch ($row[0]) {
    case "0":
        include("buien.html");
        break;
    case "1":
        include("laatsteuur.php");
        break;
    case "2":
       include("ploegtotaal.php");
        break;
    case "3":
       include("gemsnelheid.php");
        break;
            }
        }
            
?>

The include script runs appart verry wel



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source