Anyone can help me I do not know why the result is not appearing on the page
You need to connect to the database and run the query.
To connect would be something like:
function conectar()
{
try
{
//Localhost
$host = "localhost";
$user = "root";
$password = "";
$database = "nomedobanco";
$conn = mysqli_connect($host, $user, $password, $database);
} catch (Exception $ex) {
die("Erro de conexão: " . mysqli_connect_error());
}
return $conn;
}
And to execute something like:
function listar()
{
$link = conectar();
$query = "SELECT * FROM tablea";
$result = mysqli_query($link, $query) or die(mysqli_error($link));
return $result;
}