Is a global of my db connection a security risk?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/130878/global-or-singleton-for-database-connection">Global or Singleton for database connection?</a>  </p>
</blockquote>



<p>I have registered globals off.  I make a connection to my database and save it in $db.  In a function, I declare it global.  I know that makes my variable global, so I can access it with $GLOBALS even after the function returns.  </p>

<p>Did I just expose my connection to a security threat?  Do I need to pass it as a parameter each time?</p>
