Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15
  1. #11
    Join Date
    Nov 2003
    Location
    Haarlem | Netherlands
    Posts
    1,987
    Plugin Contributions
    15

    Default Re: upload category images via sql??

    Quote Originally Posted by wtashby View Post
    Try reading my last post again. I didn't say upload, I said associate! And never mind, I did it manually.
    Incredible

  2. #12
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,263
    Plugin Contributions
    3

    Default Re: upload category images via sql??

    OKAY...

    So let's assume you KNOW what Category ID's relate to what Category names and their associated images.

    In my example, I know that:
    • Category ID 1 will need image1.jpg
    • Category ID 2 will need image2.jpg
    • Category ID 3 will need image3.jpg


    Here's the SQL command I run:

    Code:
    UPDATE `categories` SET `categories_image` = 'image1.jpg' WHERE `categories_id` = 1;
    UPDATE `categories` SET `categories_image` = 'image2.jpg' WHERE `categories_id` = 2;
    UPDATE `categories` SET `categories_image` = 'image3.jpg' WHERE `categories_id` = 3;
    (Notice correct use of back-quotes around the table columns, and single quotes around the image name).

    So if you have 200 categories, you'll need 200 such UPDATE lines.

    IT WOULD HELP YOU therefore, to NAME your category images the SAME AS the category ID.

    So, for category ID 247, the image would be named image247.jpg (or just 247.jpg).

    Then, all you need do is make sure that in each update line, the CAT ID and the IMAGE NAME are the same "number".

    (You could actually compile this in a spreadsheet, then concatenate the cells to "create" the full lines. This will speed up the process considerably...)
    20 years a Zencart User

  3. #13
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,263
    Plugin Contributions
    3

    Default Re: upload category images via sql??

    Quote Originally Posted by paulm View Post
    Incredible
    Yeah... some people say "thanks" in funny ways...
    20 years a Zencart User

  4. #14
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,263
    Plugin Contributions
    3

    Default Re: upload category images via sql??

    BY THE WAY...

    With regard to post #12...

    If the images are stored in the images/category sub-folder, then you will need to include:

    categories/

    in the path:

    eg:

    UPDATE `categories` SET `categories_image` = 'categories/image1.jpg' WHERE `categories_id` = 1;


    ----------------------------------------
    20 years a Zencart User

  5. #15
    Join Date
    Jul 2010
    Location
    Kent UK
    Posts
    50
    Plugin Contributions
    0

    Default Re: upload category images via sql??

    You may want to have a look at this

    http://www.zen-cart.com/forum/showth...831#post924831

 

 
Page 2 of 2 FirstFirst 12

Similar Threads

  1. v139h Upload SQL Patch via phpMyAdmin in MySQL INSTEAD OF Amin-Tools-Install AQL patch ????
    By shags38 in forum Customization from the Admin
    Replies: 11
    Last Post: 20 Aug 2012, 04:19 AM
  2. SQL command to update category images?
    By Jeff G in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 2 Dec 2009, 10:53 PM
  3. how to i upload multiple images via ftp?
    By mbeltinck in forum Setting Up Categories, Products, Attributes
    Replies: 3
    Last Post: 25 Feb 2009, 04:13 AM
  4. How do I run the stock_attribute.sql via Install SQL Patches in admin
    By vivaraquel in forum All Other Contributions/Addons
    Replies: 4
    Last Post: 9 Apr 2007, 01:55 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR