Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.
Forums / General Questions / General Questions / SQL for Global Update of *.gif to *.jpg

SQL for Global Update of *.gif to *.jpg

Locked
This thread is locked. New replies are disabled.
25 Mar 2010, 10:09 AM
#1
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Post #1 by schoolboy

We are reformatting thousands of images from GIF to JPG

Need quick help with a SQL "UPDATE" command where the image name remains the same, but the file extensions are changed from .gif to .jpg

20 years a Zencart User

25 Mar 2010, 2:37 PM
#3
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Post #3 by schoolboy

Thanks a ton... I owe you one.

20 years a Zencart User

25 Mar 2010, 4:48 PM
#4
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Post #4 by schoolboy

Hmmm,,,

When I run that through Install SQL Patches, I get a "Failed" message...

20 years a Zencart User

25 Mar 2010, 5:09 PM
#6
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Post #6 by schoolboy

OK...

UPDATE `zen_products` SET `products_image` = CONCAT(LEFT(`products_image`,LENGTH(`products_image`)-3),'jpg') WHERE `products_image` LIKE '%.bmp'

Run through phpMyAdmin is successful, but I had to add the ` before it took properly.

(and of course, outside of ZC sql patch tool, one needs the prefix zen_ too)

Thanks...

20 years a Zencart User