I'm getting the error trying to connect to the database.
configuration.php
class Connection {
private static $connection = null;
public static get() {
if (self::$connection == null) { self::$connection = mysqli_connect("mysql.uhserver.com", "user", "passw","db" ); }
return self::$connection;
}
}
page php
header("content-type:application/json");
require_once '../includes/configuration.php';
$result= mysqli_query(Connection::get(),"SELECT Id, Titulo, Descricao, date_format(DataEvento, '%d/%m/%Y') AS DataEvento FROM agenda WHERE DATAEVENTO >= NOW() ORDER BY DATACADASTRO" ) or die(mysqli_error());
Error
syntax error, unexpected 'get' (T_STRING), expecting variable (T_VARIABLE)