I have an issue with the code below, so I have created a database connection and running it in CMD appears to be working fine, but I am not 100% how to test it out ? Can someone please point if out if its fine, Im still a newbie in PHP
<?php
class databaseConnection
{
private $host;
private $databasename;
private $username;
private $password;
public $mysqli;
//forcing the data to be given to the object (using the constructor)
public function __construct()
{
$this->databaseConnect();
}
private function databaseConnect()
{
$this->host = 'localhost';
$this->username = '$$$$$';
$this->password = '$$$$$';
$this->databasename = '$$$$$$$';
$this->mysqli = new mysqli($this->host, $this->username, $this->password, $this->databasename);
return $this->mysqli;
echo('Connection Succeeded');
}
}