Retarded question, I'm sure...
Posted: Tue May 13, 2003 2:22 pm
I've been looking through some PHP scripts on PHPbuilder.com, and I've run through this kind of code once more.
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
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;
}Help with understanding would be greatly appreciated!
Thanks!
-Jim