MySQL issue lazarus / 16-Databases ---------------------------------------------------------------------- Skevil · 2014-01-31 20:09 Hi everybody, i have a problem with mysql query. This is my code: Code: [Select]MySQLConnection1.HostName := '***'; MySQLConnection1.UserName := '***'; MySQLConnection1.Password := '***'; MySQLConnection1.DatabaseName := '***'; MySQLConnection1.Open; if MySQLConnection1.Connected then begin    SQLQuery1.SQL.Text := 'select * from clients where name=:' + Edit1.Text;    SQLQuery1.Open;    Label1.Caption:=SQLQuery1.Fields[0].AsString; end; when i run the program the label is blank. where's the error? ---------------------------------------------------------------------- taazz · 2014-01-31 21:10 Code: [Select]    SQLQuery1.SQL.Text := 'select * from clients where name=:' + Edit1.Text; That seems to be problematic just change it to Code: [Select]    SQLQuery1.SQL.Text := 'select * from clients where name=' + QuotedText(Edit1.Text); ---------------------------------------------------------------------- Skevil · 2014-01-31 21:58 unit1.pas(167,78) Error: Identifier not found "QuotedText" ---------------------------------------------------------------------- taazz · 2014-01-31 22:00 search for quoted in your help it is either quotedtext or quotedstr or something along those lines ---------------------------------------------------------------------- Skevil · 2014-01-31 22:22 QuotedStr(Edit1.Text) works well. Thank you very much. ---------------------------------------------------------------------- mirce.vladimirov · 2014-01-31 22:49 Quote from: Skevil on January 31, 2014, 11:22:33 pmQuotedStr(Edit1.Text) works well. Better use parameters, like this : Code: [Select]SQLQuery1.SQL.Text := 'select * from clients where name=:param1'; SQLQuery1.Parambyname('param1').value:=edit1.text; SQLQuery1.open; ---------------------------------------------------------------------- Skevil · 2014-01-31 23:26 more orderly and easy, thank you.