-2

when trying to update my mysql database-column with following sql command

UPDATE db.vendor_horses SET image='{"images":["' + image  + '"]}';

I get following error:

UPDATE db.vendor_horses SET image='{"images":["' + image + '"]}'    Error Code: 1292. Truncated incorrect DOUBLE value: '{"images":["'  0.00028 sec

I can't figure out what's wrong..

sg_sg94
  • 1,946
  • 3
  • 23
  • 47

1 Answers1

1

in mysql + is not valid concatenation sign. (MySQL concatenation operator) you should use CONCAT function.

UPDATE db.vendor_horses SET image= CONCAT('{"images":["', image, '"]}';
Jimmmy
  • 579
  • 16
  • 25