Results 1 to 6 of 6
  1. #1
    Join Date
    Jun 2008
    Location
    Warrenpoint, United Kingdom
    Posts
    44
    Plugin Contributions
    0

    Default Updating Attributes through SQL

    Hi,

    I used Easy Populate to update some prices for attributes, but Easy Populate dosn't seem to agree with attributes and messed them up a bit. It reset all images and setting associated with them. I have updated the image for all the products by using the SQL code:

    UPDATE products_attributes SET attributes_image = 'attributes/personalised blank red-wine.jpg' WHERE options_id = 1 and options_values_id = 9;


    but I want to update the attribute to be selected by default for all products...im guessing the code is something similar;

    UPDATE products_attributes SET (**make attribute default**) WHERE options_id = 1 and options_values_id = 9;

    does anyone know what to put into (**make attribute defualt**)???

    thanks in advance!

  2. #2
    Join Date
    Jun 2008
    Location
    Warrenpoint, United Kingdom
    Posts
    44
    Plugin Contributions
    0

    Default Re: Updating Attributes through SQL

    does anybody have any idea? ...maybe you do not understand my question?!

    I just need to know the SQL command to make an attribute option selected by default...

  3. #3
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Updating Attributes through SQL

    Are you referring to the field:
    attributes_default

    in the table:
    products_attributes

    and that you want to set it to:
    1

    when the options_id is set to :
    XX

    and the options_values_id is set to:
    XX
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  4. #4
    Join Date
    Jun 2008
    Location
    Warrenpoint, United Kingdom
    Posts
    44
    Plugin Contributions
    0

    Default Re: Updating Attributes through SQL

    Thanks for the reply...Yeah, I think that what i'm looking for...


    therefore, using my limited brain power, will it be...


    UPDATE products_attributes SET attributes_default = 1 WHERE options_id = 1 and options_values_id = 9;

    please correct me if i'm wrong?

    thanks

  5. #5
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Updating Attributes through SQL

    Providing those are the correct values then yes, that is the correct SQL ...

    I question the values as you used those for colors earlier ...

    Make sure that the Option Name is using options_id 1 and make sure that the Options Value is using the options_values_id of 9 ...

    One method is to change one manually and then pull up all of the attributes for that products_id via phpMyAdmin to see the settings ...

    Backup before running it ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  6. #6
    Join Date
    Jun 2008
    Location
    Warrenpoint, United Kingdom
    Posts
    44
    Plugin Contributions
    0

    Default Re: Updating Attributes through SQL

    Thanks Ajeh,

    that worked a treat!

    Rik

 

 

Similar Threads

  1. SQL Syntax Error when updating Account Information
    By charagg in forum Bug Reports
    Replies: 1
    Last Post: 25 Dec 2009, 03:16 AM
  2. Mass application of values/names through SQL?
    By Teeb in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 14 May 2008, 12:35 AM
  3. Populating through sql database....
    By g0d4lm1ty in forum General Questions
    Replies: 2
    Last Post: 23 Oct 2006, 08:59 PM
  4. updating cart tables with zencart.sql dump file
    By trybicki in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 3 Aug 2006, 10:49 PM

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