title: Get values from mysql database and store in php array
body: <p>I am working on a project with php and Mysql where I need to get values from Mysql database and store them into array.</p>
  
  <p>Code:</p>
  
  <pre><code>$con=new mysqli("localhost","root","","databse");
  $sql="select name from data";
  $result= array();
  $result=$con-&gt;query($sql);
  </code></pre>
  
  <p>How to store the data in php array?</p>