Hi
geht das nicht?:
PHP
class Singleton
{
// Create the instance
private static $instance = NULL;
// private constructor
private function __construct()
{
}
// return the instance
public static function get()
{
if (self::$instance == NULL)
{
self::$instance = new self;
}
return self::$instance;
}
// clone is forbbiden
private function __clone() {}
}
?>
Alles anzeigen
PHP
class MySQL extends Singleton
{
public function __construct()
{
}
public function __destruct()
{
}
public function connect()
{
}
public function close()
{
}
public function read_entry($table, $row="*", $where="id > '0'", $order="id")
{
}
public function count_entry ($table, $where="id > '0'")
{
}
}
?>
Alles anzeigen
Fatal error: Call to undefined method Singleton::connect() in D:\Program Files\xampp\htdocs\WebSpeak\index.php on line 30