title: How to make a mysql connection inside a function
body: <p>How can I make a mysql connection inside a function if my mysql connect is in another include file?</p>
  
  <p>Here is the mysql connect include file.</p>
  
  <pre><code>DEFINE ('DB_USER', 'username');
  DEFINE ('DB_PASSWORD', 'password');
  DEFINE ('DB_HOST', 'localhost');
  DEFINE ('DB_NAME', 'adfg');
  
  $dbc = mysqli_connect (DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);
  
  if (!$dbc) {
      trigger_error ('Could not connect to MySQL: ' . mysqli_connect_error() );
  }
  </code></pre>