I was trying to prevent SQL injection in my Delphi application by securing user inputs using the following query:
procedure TForm1.Button1Click(Sender: TObject);
var userNameID : string;
begin
userNameID := edit1.Text;
with adoquery1 do
begin
sql.Clear;
sql.Add('select * from users where id = :'''+userNameID+''';');
Open;
end;
end;
but it's not returning any results.
Can you tell me what's wrong in my code please?