PHP failing to run Method
<h2>Solved</h2>

<hr>

<p>In my inexperience with php I made the mistake of using :: insdead of  -> when referencing an object. Thanks again NUllUserReference.</p>

<p>.</p>

<h2>Original post</h2>

<hr>

<p>I'm having a little trouble with a basic PHP method call. I'm using the below to call the ConnectToUserDB method.</p>

<pre><code>$this-&gt;ConnectToUserDB();
</code></pre>

<p>However, when I run the code the method is never called. My code is below, I would appreciate any help you can offer.</p>

<p>-Brandon</p>

<pre><code>class Authentication 
{

    var $sql = "";
    var $userDB = "Users";
    var $use = "abuse";
    var $pa = "hammer";

    /**
     * Attempt to connect to our mySQL 
     */
    public function VerifySQL ()
    {
        $sql = @mysql_connect(); //@tells the command to fail silently

        if(!$sql)
        {
            echo '&lt;br&gt;sql connection fail &lt;br&gt; ';

        }
        else
        {
            echo '&lt;br&gt;sql connected! &lt;br&gt;';

            $this -&gt; ConnectToUserDB(); //The program seems to stop running here.
        }
    }


    /**
     * Connects to an existing user database, if none exist CreateUserDatabase creates a new one
     */
    protected function ConnectToUserDB ()
    {

        echo "&lt;br&gt; Connecting to database...&lt;br&gt;";

        if( ! @mysql_select_db($userDB))
        {
            echo "&lt;br&gt; Cannot find users database &lt;br&gt;";
            $this-&gt;CreateUsersDatabase();
        }
        else
        {
            echo "Users database exists";   
        }

    }

    /**
     * Creates a new User database with the following columns: ID,UserName,Pass,FirstName,LastName,Active,Banned
     */
    protected function CreateUsersDatabase ()
    {

            $q =
            "CREATE TABLE Users" .
            "(" .               
                "ID INT NOT NULL AUTO_INCREMENT PRIMARY KEY, " .
                "UserName TEXT, " .
                "Pass TEXT, " .
                "FirstName TEXT, " .
                "LastName TEXT, " .
                "Active BOOLEAN, " .
                "Banned BOOLEAN" .
            ")";

        if( mysql_query($q) )
        {
            echo "Users table created";
        }
        else 
        {
            echo "failure to create database";
        } 
    }

    function AddUser ()
    {

    }
</code></pre>
