Jump to content

how to write sql query in php file and so can be run on cron job?


ozfragrance

Recommended Posts

hi guys,

 

I need to put the following sql query into php file so I can run it from cron job, the query is:

 

UPDATE ps_product_shop SET visibility="none" WHERE id_product IN (SELECT id_product FROM ps_stock_available WHERE quantity=0);
UPDATE ps_product_shop SET visibility="both" WHERE id_product IN (SELECT id_product FROM ps_stock_available WHERE quantity>0);

 

I have no clue where to start, if I run this query in PhpMyAdmin it works very well, but how to implement it into php so we can easily cron it?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...