title: Dynamic MySQL table name within a class
body: <pre><code>class Patient {
  
     protected static $table_name = "siteA";
     public $id;
     public $first_dx;
     public $confidence;
     public $second_dx;
     public $path_dx;
  
  }
  </code></pre>
  
  <p>I have simply shown the class attributes here. I have CRUD methods within the class but I haven't posted them simply to make this clear. The <code>$table_name</code> above in this case is siteA however I need to make this dynamic. When a user logins into my site their site is saved in the session (siteA, siteB, siteC etc) and I need the table name here to switch depending on the person logged in. The site is <code>$_SESSION['user_site']</code>, and I have tried to use this in curly braces, no quotes, quotes etc etc and no luck.</p>
  
  <p>Clearly there is knowledge (skill) I am lacking. Can this be done? Any help is appreciated. 
  Simon </p>