title: Cannot use object of type mysqli_result as array error
body: <p>I just learned mysqli since Mysql_ queries is deprecated and people keep telling me to use mysqli instead</p>
  
  <p>so for starter I make a simple code to connect, insert and show data
  I have no problem making connection, inserting data to database but I cannot show the data using mysqli_fetch_array</p>
  
  <p>here is my code :</p>
  
  <pre><code>&lt;?php
   $sql=("SELECT * from data_orang");
   $hasil=mysqli_query($con,$sql);
    while(mysqli_fetch_array($hasil)){
    echo "nama : $hasil[nama] &lt;br&gt;
        umur : $hasil[umur] &lt;br&gt;
        kelamin : $hasil[kelamin] &lt;br&gt;";
    }
   ?&gt;
  </code></pre>
  
  <p>this is what I've tried </p>
  
  <pre><code>   echo " nama : $hasil['nama'] &lt;br&gt;
            umur : $hasil['umur'] &lt;br&gt;
            kelamin : $hasil['kelamin'] &lt;br&gt;
  </code></pre>
  
  <p>I also tried adding <code>mysqli_assoc</code> and <code>mysqli_free_result($hasil)</code> but it does not work</p>