mysql.sql.text:= ' insert into tablename set pixfield= ' + thepicture ???
where thepicture is from some vcl component, like Image1.picture?
how, in MYSQL, do I insert an image from a vcl into the table?
mysql: insert into tablename pixfield=
-
AndreyZ
Hello,
You can use the following code:
You can use the following code:
Code: Select all
Image.Picture.Bitmap.SaveToStream(ms); // where ms is TMemoryStream
MyQuery.SQL.Text := 'insert into your_table(img) values(:img)';
MyQuery.ParamByName('img').LoadFromStream(ms, ftBlob);
MyQuery.Execute;