title: include() not picking up previously defined variables
body: <p>I'm pretty sure I just need a good ol` fashion brain check. I have never seen such a silly issue and I'm sure I just missed something dumb.</p>
  
  <p><strong>index.php</strong></p>
  
  <pre><code>&lt;?
  require('lib/conf.php');
  
  /* bunch of code here */
  
  echo get_user('username',$_SESSION['uid']);
  </code></pre>
  
  <p><strong>lib/conf.php</strong></p>
  
  <pre><code>&lt;?
  /* bunch of secret stuff here */
  
  $dbcon = new PDO("mysql:host=$db_host;dbname=$db_name", $db_user, $db_pass);  
  ////////////
  //
  // Includes / Requirements
  //
  ////////////
  include('functions/user.functions.php');
  </code></pre>
  
  <p><strong>functions/user.functions.php</strong></p>
  
  <pre><code>&lt;?
  function get_user($dvar,$uid){
      $psql = $dbcon-&gt;prepare("SELECT :dvar FROM ls_users WHERE uid=:uid");
      $dbcon-&gt;beginTransaction();
      $psql-&gt;execute(array(":dvar"=&gt;$dvar,":uid"=&gt;$uid));
      foreach($psql as $row){ return $row[$dvar]; }
  }
  </code></pre>
  
  <p>However attempting to do such a simple thing, I continue to get:</p>
  
  <pre><code>Undefined variable: dbcon in &lt;b&gt;/home/lodestar/public_html/lib/functions/user.functions.php&lt;/b&gt; on line &lt;b&gt;10&lt;/b&gt;
  
  Call to a member function prepare() on a non-object in &lt;b&gt;/home/lodestar/public_html/lib/functions/user.functions.php&lt;/b&gt; on line &lt;b&gt;9
  </code></pre>
  
  <p>So, now that I feel as though I'm going crazy could you please check my brain and tell me what I'm missing?</p>
  
  <p><strong>NOTES</strong></p>
  
  <p><em>Line number in error will not reflect the correct line number in example code</em></p>