public const $servername;
public const $username;
public const $password;
public const $dbname;
public function __construct() {
$this->servername = "localhost";
$this->username = "root";
$this->password = "";
$this->dbname = "vodkafairywe";
$conn = new mysqli ($this->servername, $this->username, $this->password, $this->dbname);
}
I got the following error;
Parse error: syntax error, unexpected '$servername' (T_VARIABLE) in C:\xampp\htdocs\sometest\db_conn.php on line 5
Line 5 for me is public const $servername
;
I don't know whats wrong with it