Well, I'm doing a login system in PDO I do not understand much, but I'm going through this problem, I developed the following code below:
$select = $con -> prepare("SELECT * FROM conta WHERE conta = ? AND senha = ?");
$select -> bind_param("ss", $usuario->getConta(), md5($usuario->getSenha()));
$select ->execute();
$result = $select->fetch();
if($result == 1)
{
echo $result['codigo'];
echo 'success';
}
else
{
echo 'not_register';
}
Only the return of echo $ result ['code'] is always empty nothing appears.
and when I give a var_dump ($ result) the result of true and nothing else appears and when I give a print_r ($ result) the number 1 appears ...
Does anyone have an idea how to solve it?