smurg
2011-08-15 11:36:25
Basically, I pull off all the prices and updates of items off the GE database by having my php script load a page with the item name in the url. Then it retrieves the info from the retrieved source.
I have a separate script that redoes this and updates the values in my MySQL database. Basically, with GE updates, I want to automate this so it goes along with GE updates. So I set up a cron job to automate running my update.php every 30min. It wasn't working, so I followed someone elses advice to throw in a set_time_limit in the script to prevent the cron job from closing too early. It still doesn't work though.
I'm at work atm, but it's essentially like this.
$item_price = 100;
$item_shift = 5;
$update = mysql_query('UPDATE Table_Name SET (PRICE='.$item_price.', SHIFT='.$item_shift.') WHERE ID=$item_ID');
I normall include a file in the beginning of my sensitive database (inserting, updating files) to redirect IPs other than my own. Except I tried adding the IPs (localhost, 127.0.0.1, external ip) but it didn't work, so I just left it off for now.
When I path to the update file manually and let it load, it successfully updates all my database info, so I don't know where it's going wrong with the cron job.
Any ideas on values to set in the script? I'll post the cron job command when I get home from work.
I have a separate script that redoes this and updates the values in my MySQL database. Basically, with GE updates, I want to automate this so it goes along with GE updates. So I set up a cron job to automate running my update.php every 30min. It wasn't working, so I followed someone elses advice to throw in a set_time_limit in the script to prevent the cron job from closing too early. It still doesn't work though.
I'm at work atm, but it's essentially like this.
$item_price = 100;
$item_shift = 5;
$update = mysql_query('UPDATE Table_Name SET (PRICE='.$item_price.', SHIFT='.$item_shift.') WHERE ID=$item_ID');
I normall include a file in the beginning of my sensitive database (inserting, updating files) to redirect IPs other than my own. Except I tried adding the IPs (localhost, 127.0.0.1, external ip) but it didn't work, so I just left it off for now.
When I path to the update file manually and let it load, it successfully updates all my database info, so I don't know where it's going wrong with the cron job.
Any ideas on values to set in the script? I'll post the cron job command when I get home from work.