Jump to content

IF Else SQL Queries


kirk7880

Recommended Posts

I am using joomla with virtue-mart shopping cart and i need to have the products listed for one day only. Basically, A client will sell one "type" of products (example: a lot of pc screens (1500)). When the items are sold for the day, shop closed. The item needs to be removed at 11:59 PM and activate the new Products for the following day, BUT!!! Only if the lot for today was sold out.

In other words, If all 1500 PC screen is not sold, the item carry over to the next day until the inventory is sold out.

Table name: [b]jos_vm_product[/b] <-- Need to check this table for
Column name: [b]product_publish[/b] (Values: Y,N) <-- If [[b]product_publish='Y'[/b]] [i]check[/i]
Column name: [b]product_in_stock[/b] (Values: "Empty_String" [i]or[/i] Numerical Value) <-- If [b]product_in_stock[/b] [IS empty] [[i]UPDATE[/i] the Value of Column name: [[b]product_publish='Y'[/b] [i]TO[/i] [b]product_publish='N'[/b]]

Once the currently published item is unpublished ([b]product_publish='N'[/b]) then the Next item needs to be published. Primary keys is "[b]product_id[/b]." I assume i would need to know the current "product_id" of the item to be "[b]unpublished[/b]" so i can sequence the order of items next in line to be published.

This is killing me!

Any help would be appreciated.
Link to comment
https://forums.phpfreaks.com/topic/3873-if-else-sql-queries/
Share on other sites

Archived

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

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.