PHP Classes

File: cron.php

Recommend this page to a friend!
  Classes of Christian Zinke   Session Handler Class   cron.php   Download  
File: cron.php
Role: Example script
Content type: text/plain
Description: Cron Example
Class: Session Handler Class
Manage sessions stored in a MySQL database
Author: By
Last change:
Date: 15 years ago
Size: 634 bytes
 

Contents

Class file image Download
<?php
//If you set the CronDate in Your Tables you can easy update all your
//tables
  //This Cronjob do the same like the session_handler but only
  //once one day(see function cron), now you see how it
  // works.
  // REMEMBER DONT MAKE AN OUTPUT, this will creat an error ...

   
$sql=sprintf("SELECT cron_date FROM %s WHERE ID = '1'",
   
$this->cron_db);
   
$result = mysql_query($sql);
   
$last = mysql_fetch_row($result);
   
$sql = sprintf("DELETE FROM %s WHERE session_time < '%s'",
          
$this->session_table,
          
mysql_real_escape_string($last[0]));
   
$result=mysql_query($sql);


?>