Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Need to write a SQL script


djmonkey1

Recommended Posts

Hey-

 

I'm just looking for a quick and easy way to update old orders in my database to all be marked as "shipped". A SQL command seems like the easiest way, but I'm no good with SQL commands.

 

All it would have to say is in the table orders_status_history, wherever the orders_id falls in a range from 8-88, then the orders_status_id would be changed to 3.

 

Thanks in advance!

Stew

Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Link to comment
Share on other sites

Hey-

 

I'm just looking for a quick and easy way to update old orders in my database to all be marked as "shipped". A SQL command seems like the easiest way, but I'm no good with SQL commands.

 

All it would have to say is in the table orders_status_history, wherever the orders_id falls in a range from 8-88, then the orders_status_id would be changed to 3.

 

Thanks in advance!

Stew

 

Something like this (untested :rolleyes: )

UPDATE `orders_status_history` SET `orders_status_id`= 3 WHERE `orders_id` >= 8 AND `orders_id`<= 88

Link to comment
Share on other sites

Something like this (untested :rolleyes: )

UPDATE `orders_status_history` SET `orders_status_id`= 3 WHERE `orders_id` >= 8 AND `orders_id`<= 88

 

That almost did it, but I was asking to do the wrong thing! What I really should have asked for was this:

 

UPDATE orders SET orders_status= 3 WHERE orders_id >= 8 AND orders_id<= 88;

 

But now I'm happy! Thanks!

Do, or do not. There is no try.

 

Order Editor 5.0.6 "Ultra Violet" is now available!

For support or to post comments, suggestions, etc, please visit the Order Editor support thread.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...