2
Hello, I’m trying to make an example in codeIgniter where I want to show database data in html Formularios.
This is my query:
$id_entidade = $this->session->userdata('id_entidade');
$query = $this->db->query("SELECT * FROM entidade where id_entidade = '$id_entidade'");
foreach ($query->result() as $row){
echo $row->nome;
echo $row->email;}
Here it is working right, now I would like to know how to show it in html.
I tried to do so:
<?php foreach($query as $row): ?>
<input type="text" class="form-control" name="nome" placeholder="Nome" value="<?php echo $query->nome ;?>" />
<?php endforeach; ?>
But it’s not working, could you give me tips? I’m starting the framework study, so if I’m very wrong, I accept improvement tips.
Thank you to whom you answer, hug.