title: How can I reference variables from another included file in PHP?
body: <p>So I'm working on a PHP app and trying to make everything moduler.  I have an index.php file that includes other php files.  The first file included is settings.php which has my postgres credentials defined so they can be accessed elsewhere. The second file is connect.php that has a function you can pass sql to and it will return $result.  The third file has functions that call the sql function and receive $result and parse it.  In the third file, I can read the results of the $result however if I try if($result) it breaks and isset/empty have no effect.</p>
  
  <p>Anyone have any ideas on a way to make this work, or is my structure just terrible?</p>
  
  <p>Thanks so much!</p>
  
  <p>Mike</p>