I\'ve got this error:
Fatal error: Call to a member function query() on a non-object in /Applications/XAMPP/xamppfiles/htdocs/login.php on line 8
The line is
public function connectDB($DBServer, $DBUser, $DBPass, $DBName) { global $con; $con = new mysqli($DBServer, $DBUser, $DBPass, $DBName) or die ("Error occured"); return $con;
and then pass $con in all the functions that you define or run wherever.
$con