delete column from select * [duplicate]

2

I have an api that returns the user's data in json, but wanted to return all the data except the password, would it have some way without being select in all fields except the password? I'm currently doing this:

    if ($autenticado) {
    $resultado = $sql->select("SELECT * FROM tb_alunos WHERE email = :EMAIL LIMIT 1",array(
        ":EMAIL"=>$usermail[0]
    ));
    $response = json_encode($resultado);
}else{
    return $response->withStatus(401);
}
    
asked by anonymous 28.12.2017 / 12:33

1 answer

1

If you do not want only one column to appear you have to do the select with the name of all the others less than the column you do not want, you can not do a "select *" except a column specifies but adding only the columns you want.

    
28.12.2017 / 13:20