Ecco, ho provato a fare così:

Codice PHP:
<?php

class Database
{
    
// A static property to hold the single instance of the class
    
private static $instance;
    
    
// Server dove risiede il database
    
private $db_host "localhost";
    
    
// Username per accedere al database
    
private $db_user "root";
    
    
// Password per accedere al database
    
private $db_pass "";
    
    
// Nome del database
    
private $db_name "miodatabase";
    
    
// Connessione
    
private $conn;
    
    
    
// Il costruttore è privato e per questo non può essere istanziato
    
private function __construct$db_host=''$db_user=''$db_pass=''$db_name='' ) {
        
$this->conn self::connect$db_host$db_user$db_pass$db_name );
    }

    
// All code that needs to get and instance of the class should call
    // this function like so: $db = Database::getInstance();
    
public static function getInstance()
    {
        
// If there is no instance, create one
        
if (!isset(self::$instance)) {
            
$c __CLASS__;
            
self::$instance = new $c;
        }
        return 
self::$instance;
    }
    
    
// Funzione per connettersi al database
    
public static function connect$db_host$db_user$db_pass$db_name ) {
        if ( !
mysql_connect$db_host$db_user$db_pass ) ) {
            throw new 
Exception__CLASS__ ': ' mysql_error() );
        } else {
            
$conn mysql_connect$db_host$db_user$db_pass );
            
mysql_select_db$db_name$conn );
            
            return 
$conn;
        }
    }    
    
    public function 
getConn() {
        return 
$this->conn;
        }
    
    
// Block the clone method
    
private function __clone() {}
}

// To use, call the static method to get the only instance
$db Database::getInstance();

$db::connect("localhost""root""""naplesnightlife");

$sql "select * from admin";
$result mysql_query($sql);

$row mysql_fetch_array($result);

echo 
"<pre>";
print_r($row);
echo 
"</pre>";

?>
Così funziona benissimo , l'unica cosa anomala è che se non faccio:

Codice PHP:
$db::connect("localhost""root""""miodatabase"); 
non mi connette il database, ma a questo punto come posso connettermi al database appena faccio:
$db = Database::getInstance(); ?? Credo debba funzionare così oppure no?