I have a problem I can not reference a method that is within the class:
Follow the code below:
define("LOGIN","root");
define("PWD","");
//define("DB", "pj_fatec");
define("DB", "virtual");
define("SERVER","localhost");
class Conexao {
public static $conn;
public function open() {
self::$conn = new mysqli(SERVER, LOGIN, PWD, DB);
// Check connection
if (self::$conn->connect_error) {
die("Connection failed: " . self::$conn->connect_error);
}
}
static function getconexao(){
if(self::$conn){
return self::$conn;
}else{
$this->open();
return self::$conn;
}
}
}