Changeset 43

Show
Ignore:
Timestamp:
04/06/08 19:24:27 (2 years ago)
Author:
malko
Message:
  • autoconnect is now a static property
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/class-mysqldb.php

    r41 r43  
    77* @subpackage MYSQL 
    88* @since 2004-11-26 first version 
     9* @changelog - 2008-04-06 - autoconnect is now a static property 
    910* @changelog - 2008-03-20 - new static parameter (bool) $useNewLink used as mysql_connect new_link parameter 
    1011*                           (really usefull when working on different databases on the same host. 
    1112*                           you'd better set this to false as default if you don't need that feature.) 
    12 *           - 2007-11-20 - changing call to vebose() method according to changed made in class-db 
     13* @changelog - 2007-11-20 - changing call to vebose() method according to changed made in class-db 
    1314*            - 2007-03-28 - move last_q2a_res assignment from fetch_res() method to query_to_array() (seems more logical to me) 
    1415*            - 2007-01-12 - now dump_to_file() use method escape_string instead of mysql_escape_string 
     
    3031        * @see mysql_connect for more info 
    3132        */ 
    32         static public $useNewLink = true; 
    33  
    34   function mysqldb($dbname,$dbhost='localhost',$dbuser='root',$dbpass=''){ # most common config ? 
     33        static public $useNewLink = false; 
     34 
     35  function __construct($dbname,$dbhost='localhost',$dbuser='root',$dbpass=''){ # most common config ? 
    3536    $this->host   = $dbhost; 
    3637    $this->user   = $dbuser; 
    3738    $this->pass   = $dbpass; 
    3839    $this->dbname = $dbname; 
    39     $this->open(); 
     40    if(db::$autoconnect) 
     41        $this->open(); 
    4042  } 
    4143 
     
    171173  function query($Q_str){ 
    172174    if(! $this->db ){ 
    173       if(! ($this->autoconnect && $this->check_conn('check'))) 
     175      if(! (db::$autoconnect && $this->check_conn('check'))) 
    174176        return FALSE; 
    175177    } 
     
    339341        } 
    340342} 
    341 ?>