Quote:
Originally Posted by vodka00
This set all attrs fields that were in equipment to 0.
|
Yeah I checked it in SQL fiddle. Soon as I try to place alongub's SQL code in, this error appears:
Schema Creation Failed: Data truncation: Truncated incorrect DOUBLE value: ', "lifetime": 0.5, "width": 15, "endwidth": 3, "fadelength": 5, }':
From what I could see, the + operator is replaced by CONCAT in MySQL? So for a MySQL database the correct SQL statement would be:
Code:
UPDATE store_items SET attrs = CONCAT(LEFT(attrs, Length(attrs) - 1), ', "lifetime": 0.5, "width": 15, "endwidth": 3, "fadelength": 5, }') WHERE type = 'equipment';
That would appear to work - check the SQL Fiddle(
http://sqlfiddle.com/#!2/666ae/1)
__________________