title: mysqli_insert_id() not working?
body: <p>I'm getting quite angry over this, I don't know how can this simple situation be so complicated and not work.</p>
  
  <p>Basically:</p>
  
  <pre><code>$lastInsertId = mysqli_insert_id($query);
  echo $lastInsertId;
  </code></pre>
  
  <p>returns NULL</p>
  
  <p>my $query runs fine, inserts perfectly. Anyone knows why I'm not getting the last insert id?</p>