Jump to content
Eugenio

UPDATE PRODUCTS WITH SQL

Recommended Posts

HI!!

 

I USUALLY USE THIS SQL:

 

 

 

UPDATE `ps_product` SET `quantity`= 1000

 

UPDATE `ps_product_attribute` SET `quantity`= 1000

 

 

 

BUT I NEED TO DO THE SAME BUT ONLY WHEN PS_PRODUCT ARE > 0

 

SORRY FOR MY ENGLISH

 

THANKS!!

Edited by Eugenio (see edit history)

Share this post


Link to post
Share on other sites

see: http://dev.mysql.com.../en/select.html

 

Answer:

UPDATE `ps_product` SET `quantity`= 1000 WHERE `quantity`>0

 

UPDATE `ps_product_attribute` SET `quantity`= 1000 WHERE `quantity`>0

 

THANKS!!!

 

AND LAST QUESTION!! CAN I DO IT AUTOMATICALY WITH SOMETHING LIKE CRON?

Share this post


Link to post
Share on other sites

THANKS!!!

 

AND LAST QUESTION!! CAN I DO IT AUTOMATICALY WITH SOMETHING LIKE CRON?

 

Yes, you can use it with cron in many ways.

I suggest that you can put sql code into php script, and add script to croon

Share this post


Link to post
Share on other sites

Yes, you can use it with cron in many ways.

I suggest that you can put sql code into php script, and add script to croon

 

seriusly? Where i can find help of this!! i what to do it... thanks

Share this post


Link to post
Share on other sites

Create php script that will use SQL commands (mysql_query in php) then in configure your CRON jobs for something like that:

* * * * * /usr/bin/lynx -dump http://address.domain/script.php

 

sometimes hosting providers share a Cpanel or kloxo panel, there you can set up cron jobs without access to shell on server

Edited by vekia (see edit history)

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More