I have a function inside my class to list data; Here is the code below:
public function listadados(){
try{
//retornar um array
$sql = "SELECT * FROM web_cadcli";
$lista = $this->con->conectar()->prepare($sql);
$lista->execute();
$retDados = array ( $lista-> fetchAll(PDO::FETCH_ASSOC));
print_r($retDados);
}catch(PDOException $erro_2){
echo 'erro'.$erro_2->getMessage();
}
}
I want to put the return that is below. inside an html
Array
(
[0] => Array
(
[0] => Array
(
[idcad_cliente] => 1
[nm_cliente] => Rodrigo Zanetti
[email_cliente] => [email protected]
[senha_cliente] => 7ik3ikelek
[id_identpess] => 1
[img] =>
)
[1] => Array
(
[idcad_cliente] => 2
[nm_cliente] => Rodrigo Zanetti
[email_cliente] => [email protected]
[senha_cliente] => k3ik3ik3ikkejeh
[id_identpess] => 1
[img] =>
)
[2] => Array
(
[idcad_cliente] => 3
[nm_cliente] => Adriana Silva Souto
[email_cliente] => [email protected]
[senha_cliente] => k3ikeikeikeieçeoel
[id_identpess] => 1
[img] =>
)
This screen below is my template, where I want to return the formatted values. name underneath NAME: email below EMAIL, as a table.
listados (); ? >
<table class="table table-striped table-bordered table-hover">
<thead>
<tr class="active">
<th>Nome</th>
<th>E-mail</th>
<th>Editar</th>
<th>Deletar</th>
</tr>
</thead>
<tbody>
</table>