0
I’m doing a query system wanted to transfer a variable per href, I do a query by "status" OPEN or CLOSED after this inform only the ID not to get too much information on the screen, and needed to create a href for another page view expanding the registration. Follow my Cod to better understand, if anyone has a hint thank you.
Controller:
$palavra = $this->input->post("palavra");
$usercadastro = $this->model_c->consultar($palavra);
if ($usercadastro->num_rows() == 1) {
$dados['consulta'] = $this->model_c->consultarnc();
$this->load->view('ConsultaCadastro_v', $dados);
}elseif ($usercadastro->num_rows() == 0) {
$dados['consulta'] = $this->model_c->consultarnc02();
$this->load->view('ConsultaCadastro_v', $dados);
}
}
View:
<h1>RNCS</h1>
<hr />
<?php foreach ($consulta as $cadastro) : ?>
<p><strong>Bairro:</strong> <a class="font-weight-bold" ><?php echo $cadastro->bairro ?></p></a>
<p><strong>Nome:</strong> <a class="font-weight-bold" ><?php echo $cadastro->nome ?></p></a>
<p><strong>complemento:</strong> <a class="font-weight-bold" ><?php echo $cadastro->complemento ?></p></a>
<hr />
<?php endforeach; ?>
Thank you Lucas!
– user144273