title: var for a class in PHP
body: <p>I am using a PHP class for login purposes. The MySQL database that the login process checks for the user is defined like this:</p>
  
  <pre><code>    class flexibleAccess{
  
    var $dbName = 'mydatabase';
  </code></pre>
  
  <p>However, as I install the application for different people, this $dbName needs constant changes. I have decided to make a config file where I keep my database information so I would have to change there witch is more easy as this login class is "hidden" somewhere. The problem is I want to do something like this:</p>
  
  <pre><code>class flexibleAccess{
  
        var $dbName = $_SESSION['mydatabase'];
  </code></pre>
  
  <p>And I get the error: "Parse error: parse error in <em>path</em>/access.class.php on line 43"
  The line 43 is the line with $dbName... Why can't I use this to dynamically get my values from the session ? And how should I use it ?</p>
  
  <p>Thanks</p>