0
Good morning I would like to know how to display only my name that is in the database instead of displaying everything in a table.
public Function all(){
$sql = $this->con->prepare("SELECT * FROM usuario");
$sql->execute();
$rows = $sql->fetchAll(PDO::FETCH_CLASS);
if (!$rows) {
$_SESSION['cor']='danger';
$_SESSION['msg'] = "<b>Nenhum usuário cadastrado</b>";
}
return $rows;
}
Not if I use the "WHERE id" or if you have another easier way.
If you use "Where id" you will restrict the record only with the given id.
– Rodrigo Zem