title: PHP changing to mysqli. Is the mysqli_connection not global?
body: <p>I have just started a new PHP project and I was thinking it's time to follow php suggestion and stop using mysql and swith to mysqli instead. But this gave me a problem.</p>
  
  <p>Normaly my setup is like this</p>
  
  <p>Index.php file and inside this file I have a 2 require statements. One that calls for the db.php file and one other to call a functions.php file. So far so good.</p>
  
  <p>In the functions.php file a have a lot of different functions that is used all over the homepage and many of these are using SQL. 
  With php old mysql API this was no problem but it seams that the new mysqli api don't allow connections to be used from included files???</p>
  
  <p>For example in my db.php I have the connect statement. <code>$db = mysql_connect(*******);</code>
  And in my function.php I have <code>mysql_query(******)</code> and it works perfect.</p>
  
  <p>But if I change the db.php to <code>$db = mysqli_connect(*****);</code>
  Then in my function.php file I can't call the <code>mysqli_query(***)</code>. (I have also tested object oriented but it gives me the same problem).</p>
  
  <p>So how to get around this problem?
  Is php expecting me to put the mysqli_connect statement in the beginning of <em>every</em> file that uses sql statements?</p>