function SQLConnect($params) {
## Connect to MySQL database
global $L3Config,$L3_queris,$L3_error_level;
global $L3_sql_lasterr;
$L3_sql_lasterr=0;
if(!isset($params['server'])) $params['server']='localhost';
if( version_compare($ver=phpversion(),'4.2.0') >= 0 ) {
$dbh=@mysql_connect( $params['server'] ,$params['user'],$params['password'], true );
} else {
$dbh=@mysql_connect( $params['server'] ,$params['user'],$params['password']);
if( $L3_error_level>0) @$L3_queris.="Please upgrade php from $ver to 4.2.0 or highher";
}
if( $L3_error_level>0) {
@$L3_queris.="Connect ($dbh) $params[server] ,$params[user] $params[database] ".strlen($params['password']).":\n".mysql_error($dbh)."\n";
};
if( isset( $params['database'] ) )
mysql_select_db( $params['database'] ,$dbh );
if(!$L3Config['db.link_id'] ) $L3Config['db.link_id']=$dbh;
$L3Config[$dbh]=$params['user'].'@'.$params['server'].'/'.$params['database']."($dbh)";
if( $L3_error_level>0) {
@$L3_queris.="Connected as $dbh\n".mysql_error($dbh)."\n";
};
return $dbh;
}