How do you imagine that DataBase class will receive information about database, user, password and host?
You'll need to receive that information in the constructor of the child class and then call parent::__construct()
with these arguments.
There's really no other way, except you prefer anti-patterns and bad design.
In your child class:
function __construct($localhost, $user, $password, $dbname, $tbname){
$this->tbname = $tbname;
parent::__construct($localhost, $user, $password, $dbname);
}
Actually it'd be better to just inject a DataBase instance into the display class instead of using inheritance here. You might want to reuse the same connection multiple times.
function __construct(DataBase $db, $tbname){
$this->tbname = $tbname;
$this->database = $db;
}
// you can now install some __call() wrapper in your DataBase class to proxy calls to $db property
and in your main code
$db = new DataBase($localhost, $user, $password, $dbname);
$display = new display($db, $table);
// now you can reuse $db for other classes/direct use.