title: Insert into MySQL from array with mysqli
body: <p>I want to insert some data from a parsed JSON to a table, but when I do it, it doesn't work, it returns 0 rows, what am I missing? I'm new yet with this "mysqli". I have more than 25000 rows to insert to the table.</p>
  
  <pre><code>$mysqli = mysqli_connect('localhost', 'root', '', '');
  
  $allData = $dataSource-&gt;getAllData();
  foreach ($allData as $key =&gt; $value) {
      $query = 'INSERT INTO `table`(`data_id`, `name`) VALUES (' . $value['data_id'] . ', ' . $value['name'] . ')';
      $result = mysqli_query($mysqli, $query);
  }
  </code></pre>