Storing MySQL query result into a PHP array : <p>Looking at all the questions are using the depreciated <code>mysql_fetch_assoc/array,</code> hence I don't think that this is a duplicate question.</p>

<p>I have a MySQL table with 5 columns, </p>

<p><code>ID | NAME | AGE | GENDER | HEIGHT</code></p>

<p>If I want to store the values of <code>NAME, AGE, GENDER</code> in a PHP array, </p>

<pre><code>$query=$mysqli-&gt;query("SELECT NAME,AGE,GENDER FROM TableName")
while($result = $query-&gt;fetch_assoc()
{
$array = [];
}
</code></pre>

<p>Will my array be stored in the format of 
<code>$array=[[Name,Age,Gender],[Name,Age,Gender]]</code>?</p>

<p>If not, what would be my approach in doing this?</p>
