Get error Notice: Array to string conversion
what's wrong in this line $this->database['dsn'] = "mysql:host=$this->database['host'];dbname=$this->database['db']";
my code
class databaseClass {
// data variables
private $database;
// Construct
public function __construct() {
// database info
$this->database['host'] = 'localhost';
$this->database['db'] = 'dbname';
$this->database['username'] = 'root';
$this->database['password'] = '123';
$this->database['dsn'] = "mysql:host=$this->database['host'];dbname=$this->database['db']";
}
}