Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, object given in
<p>I've got a little bit of a problem when I try to run this code. I receive this error:</p>
<blockquote>
<p>Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, object given in</p>
</blockquote>
<p>My problem is in the <code>while</code> statement on <strong>line 32</strong>:</p>
<pre><code>$connection = mysqli_connect($host, $username, $password, $db_name);
$sql = 'SELECT * FROM provinsi';
while ($r = mysqli_fetch_array($connection, $sql)) { // line 32
    $id = $r['id'];
}
</code></pre>