Hello, I'm trying to make a listing with data in a table with the code below, but I'm not getting it. I've done it in several ways, I've seen tutorials on the internet and everything, but it does not work. On the server both local and external nothing appears, everything is white. Could someone tell me if there is an error in this code?
<?php
require_once("Conn.php");
$conexao = conectar();
$query = "SELECT * FROM tab_final";
try{
$selecionar = $conexao->prepare($query);
$selecionar->execute();
$select = $selecionar->fetchAll(PDO::FETCH_OBJ);
foreach($select as $listar){
echo "Times: ".$listar->Nome."<br />";
}
}catch(PDOException $e){
echo $e->getMessage();
}
?>
I used up the FETCH_ASSOC and changed the echo to conform to it and nothing. I do not know what else to do. If anyone can test and succeed, help me, please! Thank you!