1
Hello, I’m trying to make a list with data in a table with the code below, but I’m not getting it. I’ve done several ways, I’ve seen tutorials on the Internet and everything, however, it comes to nothing. On the server both local and external nothing appears, everything is white. Someone could let me know 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 even used the FETCH_ASSOC and changed the echo to be according to the same and nothing. I don’t know what else to do. If anyone can test and get it, please help me! Thanks in advance!
Thank you very much, Ack. I studied your code and got it, now you’re listing the data from the table.
– Carlos Henrique