Welcome Guest, Not a member yet? Register   Sign In
Cronjob in CodeIgniter
#1

[eluser]Sudz[/eluser]
How to set Cronjob in CodeIgniter?
Is there Any Tutorial or sample code?
Please suggest!!!!!!
#2

[eluser]Bigil Michael[/eluser]
in your cpanel there is one field to set cron job

there u pasted code like this

php /home/cpanel username/public_html/cron.php

and set execution time

put cron.php inside public html
sample cron.php
Code:
<?php
define('BASEPATH',1);
include('system/application/config/database.php');
include('system/application/config/config.php');
$con = mysql_connect($db['default']['hostname'],$db['default']['username'],$db['default']['password']);
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }
mysql_select_db($db['default']['database'], $con);
    $current = date("Y-m-d ");
    mysql_query("update packages set status ='0' where valid_till = '$current'");
mysql_close();
?>
#3

[eluser]Ken Verhaegen[/eluser]
In the wiki of CI you'll find these pages:
"Cron Job Bootstrapper"
"Category Advanced -> Cronscript"
#4

[eluser]sblaas[/eluser]
Bootstrapper is no longer needed from version 2.x

[quote author="Ken Verhaegen" date="1304343859"]In the wiki of CI you'll find these pages:
"Cron Job Bootstrapper"
"Category Advanced -> Cronscript"[/quote]
#5

[eluser]Ken Verhaegen[/eluser]
[quote author="sblaas" date="1304441021"]Bootstrapper is no longer needed from version 2.x[/quote]

Good to know, I only used Google btw...




Theme © iAndrew 2016 - Forum software by © MyBB