shedule a php script
| From: | CurlyBraces Technologies \( Pvt \) Ltd | Date: | Sat, 05 Jun 2004 15:46:20 +0000 |
| Subject: | shedule a php script | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-187684@lists.php.net to get a copy of this message | ||
hi friends ,
when running this php script we can make a log file with relavent to the mysql data base. but i need
to execute this script after every 2 min time. that is mean there must be a 2 min sleep time . can
somebody help me do this function plz .........?
<?php
require ('connectMySql.php');
$select= " select ServiceNo, ServiceName, Status, DateTime from ServiceStatus ";
$add_member = $db_object->query($select);
$result=mysql_query($select);
while($row=mysql_fetch_array ($result))
{
$output1 =$row['ServiceNo'];
$output2 =$row['ServiceName'];
$output3 =$row['Status'];
$output4 =$row['DateTime'];
$your_data .= " $output1.\t $output2 -> $output3 -> $output4 \n";
$output = "$your_data \n";
}
// Open the file and erase the contents if any
$fp = fopen("vas_status.log", "a");
// Write the data to the file
fwrite($fp, $output);
// Close the file
fclose($fp);
if (DB::isError($add_member)) {
die($add_member->getMessage());
}
$db_object->disconnect();
?>
thanx in advance
curlys