title: Inserting JSON data into MySQL table
body: <p>I have been following a solution (<a href="https://stackoverflow.com/questions/22523575/how-to-insert-json-array-into-mysql-database">How to insert json array into mysql database</a>) into how to insert JSON data into a MySQL table. The code seems to run okay but it is still returning an empty data set.</p>
  
  <p>I'm currently testing a hypothesis and my JSON file has 100,000 records in it. I have created a similar JSON file with just three records thinking that the size of the file may have been impeding it but that didn't work either.</p>
  
  <p>I have checked my database name, table name and row names but is correct with the code shown. Any pointers?</p>
  
  <pre><code>&lt;?php 
  $json = file_get_contents('E:\xampp\htdocs\MOCK_DATA.json');
  $obj = json_decode($json, true);
  
  $connection = mysqli_connect("localhost", "root", "");
  mysqli_select_db($connection, "et_test") or die('Couldnt connect database');
  
  foreach($obj as $item)
  {
      mysqli_query($connection, "INSERT INTO 'et_test'.'test' (first_name, last_name, colour, country, city)
  VALUES ('".$item['first_name']."','".$item['last_name']."','".$item['colour']."','".$item['country']."','".$item['city']."')");
  }
  mysqli_close($connection);
  ?&gt;
  </code></pre>