Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2006
    Location
    Boise, ID
    Posts
    334
    Plugin Contributions
    0

    Default SQL find and replace

    Hello, I have changed the order status line of shipped, deliverd and such, so now of course all my deliverd order that were a #6 now need to be a 20 so all my delivered orders are showing.

    how do I do a find and replace with sql in the DB ?

    I did a find for all order_status = 6 in the OREDER table and found them, now I want to Run SQL query/queries on database and change all the order_status from 6 to 20

    or I will be editing alot of orders :-( to get the status back to a delived #20

    SELECT * FROM `orders_status` WHERE 1

  2. #2
    Join Date
    Feb 2006
    Location
    Boise, ID
    Posts
    334
    Plugin Contributions
    0

    Default Re: SQL find and replace

    on the orders table I need to find and replace the orders_status from a number 6 to number 20

  3. #3
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: SQL find and replace

    Quote Originally Posted by gloerick View Post
    on the orders table I need to find and replace the orders_status from a number 6 to number 20
    Code:
    UPDATE `orders` SET `orders_status`= 20 WHERE  `orders_status`= 6 ;
    Usual rules apply. Backup first.

    Cheers
    Rod

  4. #4
    Join Date
    Sep 2017
    Location
    Raleigh, NC, United States
    Posts
    41
    Plugin Contributions
    0

    Default Re: SQL find and replace

    Quote Originally Posted by RodG View Post
    Code:
    UPDATE `orders` SET `orders_status`= 20 WHERE  `orders_status`= 6 ;
    Usual rules apply. Backup first.

    Cheers
    Rod


    This thread was helpful for my needs in 2022. I ended up doing:

    UPDATE `orders` SET `orders_status`= 3 WHERE `orders_status`= 2 ;
    which updated any processing to delivered

    I then changed two money orders I was waiting on to update status (4) in the UI
    then did
    UPDATE `orders` SET `orders_status`= 3 WHERE `orders_status`= 1 ;
    to process any pending money orders

    And then I manually moved the two status 4 back to status 1.

    Before I did any of this I did one order to processing that I get the email to make sure I didn't get an email when I did the SQL change (obviously not but I'm changing 10k orders so being careful) and it did not email me as I had thought - UPDATE `orders` SET `orders_status`= 3 WHERE `orders_id`= 1 ;

  5. #5
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,671
    Plugin Contributions
    123

    Default Re: SQL find and replace

    Thanks for sharing your success!
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

 

 

Similar Threads

  1. v151 Site wide Find and Replace?
    By pietpetoors in forum General Questions
    Replies: 1
    Last Post: 28 Nov 2014, 05:14 PM
  2. SQL to replace product id how to?
    By explorer1979 in forum General Questions
    Replies: 6
    Last Post: 27 May 2011, 05:32 AM
  3. Find/Replace Products_Url text
    By sparrowce in forum Basic Configuration
    Replies: 4
    Last Post: 2 Mar 2011, 10:31 AM
  4. Replies: 13
    Last Post: 8 Dec 2009, 03:30 AM
  5. Find & replace feature in editor?
    By kevinmc3 in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 21 Jul 2009, 10:45 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