Good afternoon, I have a class where I pass all methods insert
, update
, delete
, consulta(fechall)
and consulta(fech($id))
Below I show the class of consulta(fech($id))
public function selId($id){
$sqlId = "SELECT * FROM web_cadcli WHERE idcad_cliente = ':id_us', nom_cliente = $this->getNome($nome), ema_cliente = $this->getEmail($email), senha_email = $this->senha($senha) ";
$sqlId = $this->con->conectar()->prepare($sqlId);
$sqlId->bindParam(':id_us', $this->cod, PDO::PARAM_INT);
$sqlId->bindParam(1, $this->nome, PDO::PARAM_STR);
$sqlId->bindParam(2, $this->email, PDO::PARAM_STR);
$sqlId->bindParam(3, $this->senha, PDO::PARAM_STR);
$sqlId->execute();
return ($sqlId->fetch(PDO::FETCH_ASSOC));
}//retorna o Id do Usuario - testar
I want to fetch values in the database with ID and later retrieve it on my form
Below I show my form with the code where I need to retrieve the values.
<?PHP
$Objeto = new Usuario();
$usuario = $Objeto->selId(); ?><!--SELECIONO O ID DO METODOS selId-->
<input name="id_ui" type="hidden" value="id_usu"/>
<div class="form-group">
<label for="exampleInputEmail1">Nome</label>
<input type="nome" class="form-control" id="exampleInputEmail1" value="<?php $usuario->setNome($nome); ?>">
</div>
<div class="form-group">
<label for="exampleInputPassword1">Email</label>
<input type="email" class="form-control" id="exampleInputPassword1" value="<?php $usuario->setNome($nome) ?>">
</div>
<div class="form-group">
<label for="exampleInputFile" disable>Imagem</label>
<input type="file" id="exampleInputFile">
</div>
</form>