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

Link to comment
Share on other sites

i wouldn't count on update.php running on it's own. you should specify the full path the php and the full path to your file. if this is on your hosting companies server, i would check their FAQ section, as it is most likely there.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.