Skip to content

Instantly share code, notes, and snippets.

@viniciussanchez
Created June 6, 2021 15:00
Show Gist options
  • Save viniciussanchez/c5ab0ab737e7ee359cd58e227dd65f90 to your computer and use it in GitHub Desktop.
Save viniciussanchez/c5ab0ab737e7ee359cd58e227dd65f90 to your computer and use it in GitHub Desktop.
Without SQL Injection
begin
qryUsuarios.SQL.Clear;
qryUsuarios.SQL.Add('select *');
qryUsuarios.SQL.Add(' from user');
qryUsuarios.SQL.Add(' where login = :login');
qryUsuarios.SQL.Add(' and password = :senha');
qryUsuarios.ParamByName('login').AsString := edtUsuario.Text;
qryUsuarios.ParamByName('senha').AsString := edtSenha.Text;
qryUsuarios.Open();
if qryUsuarios.IsEmpty then
lblResultado.Caption := 'ERRO!!!'
else
lblResultado.Caption := 'Ok';
end;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment