Help with static class members
<p>I have always used $this in my classes. Now I have to use a static class and I'm lost. Can someone please tell me how to convert this to use static members? I've tried to look at some tutorials but they are not easy to understand. I also have no idea how to "instantiate" a static class so if someone could please provide an example, I'd be grateful.</p>

<p>Thanks.</p>

<pre><code>class db
{
    private static $instance;
    private static $database_name;
    private static $database_user;
    private static $database_pass;
    private static $database_host;
    private static $database_link;

    private function db()
    {
        self::$database_name = "name";
        self::$database_user = "user";
        self::$database_pass = "password";
        self::$database_host = "host";
    }

    public static function getInstance()
    {
        if (!self::$instance)
        {
           ?????

          self::$instance = connect();
          return self::$database_link;
        }
        return self::$instance;
    }

    function dbLink()
    {
      self::$connect();
      return self::$database_link;
    }
...
</code></pre>

<p>EDIT:</p>

<p>Also, I'm really curious as to the advantages to using static classes over class members that can be used outside the class. I'd assume security but that's about it.</p>
