Page 1 of 1

Retarded question, I'm sure...

Posted: Tue May 13, 2003 2:22 pm
by Jim
I've been looking through some PHP scripts on PHPbuilder.com, and I've run through this kind of code once more.

Code: Select all

// connection parameters 
    var $host = '';
    var $user = '';
    var $pass = '';
    var $database = '';
    var $persistent = false;
    var $link = NULL;
    var $result = false;

    // Constructor
    // Initializes member variables
    function DB($host, $user, $pass, $database='', $persistent = false) {
        $this->host = $host;
        $this->user = $user;
        $this->pass = $pass;
        $this->database = $database;
        $this->persistent = $persistent;
    }
I'd like to know what "$persistent" is for. I don't really understand why it's necessary if it's always set to false anyway. What does it mean? I'm assuming it means that the MySQL connection won't stay open after the execution of the script, but I'm not entirely sure.

Help with understanding would be greatly appreciated!

Thanks!

-Jim

Posted: Tue May 13, 2003 2:54 pm
by nigma
false is just the default value of persistant, you could pass the value true to the method if you wanted.