I'm trying to create an array with the contents of a tabela
of my banco
but I do not know how, I tried to do this:
// ATRIBUI UMA CONEXÃO PDO $pdo = Conexao::getInstance(); // ATRIBUI UMA INSTÂNCIA DA CLASSE CRUD $crud = Crud::getInstance($pdo, 'cadAgendaEvento'); // BUSCANDO EVENTOS $sqlEvento = "SELECT * FROM 'cadAgendaEvento'"; $dados = array(); foreach ($sqlEvento as $Retorno) { $dados = $Retorno; echo json_encode( array( "success" => 1, "result" => $dados ) ); }
I would like to know if this format is correct, apparently it is not returning anything to me.