PHP db connection variable, best way to access in multiple places
<p>Okay, it seems the word on the street is that global variables are bad.</p>

<p>Well, if I have:</p>

<pre><code>$dbc = mysqli_connect(DB_HOST,DB_USER,DB_PASSWORD,DB_NAME);
</code></pre>

<p>and then I have several functions and such that all depend on that db connection, what is the most sound way to access $dbc in all my functions?</p>

<p>Is this a case where making it global is okay? Declaring it as a global variable inside each function seems redundant. </p>

<p>What is the best way to tackle this?  </p>
