I have the following error: Warning: count (): Parameter must be an array or an object that implements Countable in ... and I really do not know why you are giving it to me, the code is the following: '
protected static $conexion;
private static function getConexion(){
self::$conexion = Conexion::conectar();
}
private static function desconectar(){
self::$conexion = null;
}
/**
* Metodo que sirve para validar el login
* @parametro objeto $usuario=cedula
* @return booleano
*/
public static function login($cedula){
$sql = "SELECT
id,nombre,apellido,cedula,correo,privilegio,fecha_registro
FROM usuarios WHERE cedula = :cedula AND pass = :pass";
self::getConexion();
$resultado = self::$conexion->prepare($sql);
$resultado->bindValue(":cedula", $cedula->getCedula());
$resultado->bindValue(":pass", $cedula->getPass());
$resultado->execute();
if (count($resultado)){
return true;
}
return false;
}
And I'm trying to insert the following values
public static function login($cedula, $pass){
$obj_usuario = new Usuario();
$obj_usuario->setCedula($cedula);
$obj_usuario->setPass($pass);
UsuarioDao::login($obj_usuario);
}
I really do not know what I'm doing wrong if someone could help me or need more information I would give it, I need to solve this urgent problem