#!/usr/local/bin/php -q

<?php

// Establish connection parameters
//
	$hostname = "astraea2";   //declaring variables for mysql access
	$databasename = "probe_l0_process"; //all these values are unavailable to the user and thus secure
	$username = "thmsoc";   //these will have to be set for all search forms that access the mysql database
	$password = "ishkabibel";

	if ($_SERVER['argc'] !=4 )
  {
		die("Check arguments: Need filename, processtime\n") ;
	}

// Assign command line input variables
//
	$filename = $_SERVER['argv'][1] ;
	$processtime = $_SERVER['argv'][2] . " " . $_SERVER['argv'][3] ;

	/*
	print "filename = " . $filename . "\n" ;
	print "processtime = " . $processtime . "\n" ;
	*/


// Make connection to MySQL server
//
$databaselink = mysql_connect($hostname, $username, $password) 
		or die("Could not connect: " . mysql_error());

// Select particular database
//
  mysql_select_db($databasename, $databaselink) or die("Could not use database: $databasename");

	$db_input = "update VC_Files_Processed set Archive = 1 where FileName=\"$filename\" and ProcessStartTime = \"$processtime\"" ;
  $results = mysql_query($db_input)
	    or die("Could not query: " . mysql_error());
?>
