<?php

function historique($myFile,$message,$session_id)
{


	//Trouver l'usager
	$sql_usager = "SELECT usager
	FROM rec_usagers
	WHERE idsession = '$session_id';";
	$result_usager = mysql_query($sql_usager) or die("Probl&egrave;me de recherche du client!".$sql_usager."<br>");
	$row_usager = mysql_fetch_row ($result_usager);
	$nom = $row_usager[0];

	$fh = fopen($myFile, 'a+') or die("can't open file");
	$date = date('Y-m-d H:i:s');
	$stringData = $date." - ".$nom." - ".$message." \r\n";
	fwrite($fh, $stringData);
	fclose($fh);
}


//historique("historique.txt","message",$session_id);

?>
