Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2008
    Posts
    627
    Plugin Contributions
    0

    Default SQL query needed

    I have a mod installed to include the condition of my items. I want to run an sql patch to update the products all at once to all have the same condition set as used. Then I can go back and revise the very few items that are new. I updated one product in phpmyadmin and have this sql patch

    UPDATE `username_zc1`.`zen_products` SET `products_condition` = 'used' WHERE `zen_products`.`products_id` =5;

    Can this code be adjusted so I can run it to change all products_condition at once?

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

    Default Re: SQL query needed

    If you do not limit it with the WHERE clause then ALL Products in the products table will get updated with that ...
    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!]
    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!

  3. #3
    Join Date
    Jun 2008
    Posts
    627
    Plugin Contributions
    0

    Default Re: SQL query needed

    so would this be correct?

    UPDATE `username_zc1`.`zen_products` SET `products_condition` = 'used';

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

    Default Re: SQL query needed

    Or, if you want to run it from your Zen Cart Admin, you can use the Tools ... Install SQL Patches ... using:
    UPDATE products SET products_condition = 'used';
    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!]
    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!

  5. #5
    Join Date
    Jun 2008
    Posts
    627
    Plugin Contributions
    0

    Default Re: SQL query needed

    Great! Thank you :-)

 

 

Similar Threads

  1. Replies: 9
    Last Post: 12 Jul 2023, 12:26 AM
  2. v154 Help with a SQL Query for Query Builder
    By lindasdd in forum Managing Customers and Orders
    Replies: 2
    Last Post: 24 Mar 2016, 01:18 PM
  3. v151 SQL query setup. How do I TEST a query 'off-line'?
    By lewisasding in forum General Questions
    Replies: 3
    Last Post: 8 Mar 2013, 12:24 AM
  4. Replies: 2
    Last Post: 15 Aug 2011, 04:58 AM
  5. Query sql needed to remove customers that aint ordered
    By Xbox Memberships in forum General Questions
    Replies: 0
    Last Post: 2 Apr 2010, 04:18 PM

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