class DBHandler{ function DBHandler(){ $this->dbconnect("p328637_hnwp4173","p328637_hn4173","Testdn*4ncA3","10.16.9.16"); } function getConnection(){ static $connection; if(!isset($connection)){ $connection = new DBHandler(); } return $connection; } function dbconnect($dbname="fotos",$user="root",$password="",$server="localhost"){ if (!(mysql_connect($server,$user,$password))){ print "
$query\n"; } $result = mysql_query($query) OR die("Query failed".$query); return $result; } } ?>