Tuesday, 15 July 2014

How to update multiple column values in MySQL table -



How to update multiple column values in MySQL table -

i want update image path in mysql table. table schema this:

table_brands - brand_id, brand_name, brand_image_path

currently path stored as-

`images/1.png` `images/2.png`

i want create as

`images/brands/1.png` `images/brands/2.png`

also entries path stored as

`images/brands/1.png` `images/brands/2.png`

so changes should not done such entries.

can help me?

you can utilize replace function purpose image paths don't contain 'brand'

update table_brand set brand_image_path = replace(brand_image_path, 'images', 'images/brands') brand_image_path not '%brands%';

mysql

No comments:

Post a Comment