Jump to content

[SOLVED] Execute PHP every 10 minutes


MadDawgX

Recommended Posts

Ok, so say I have a script titled 'update.php' in the index of my website.

 

When I goto my cpanel, I have an item called Cron Jobs which I then get to a page where I specify the command. So is this what I put?

 

MINUTE HOUR DAY MONTH WEEKDAY    COMMAND

 

  10      *      *      *          *            update.php

 

Or do I have to specify an exact path? Im on a shared server through Bihira.com btw

Ok, so I checked with my host I got an answer; here's the command:

 

php /home/ufnwvwju/public_html/temp/cron_shares.php

 

But it doesn't seem to be working?

 

Here is cron_shares.php:

 

	// *******************************
// INITIALIZE
// *******************************
session_start();
mysql_connect("localhost", "****", "****") or die(mysql_error());
mysql_select_db("ufnwvwju_sb") or die(mysql_error());
// *******************************
// CRON JOB
// *******************************
$g_stats = mysql_query("SELECT * FROM sb_stats");
$stats_shares = mysql_result($g_stats,0,'stats_shares');
$stats_mbal = mysql_result($g_stats,0,'stats_mbal');
$share_value = number_format($stats_mbal / $stats_shares,4);
$i_share = mysql_query("INSERT INTO sb_shares (shares_value) VALUES('$share_value')");	

 

But the database is turning up empty?

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.