<?php 

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


	//Trouver l'usager
	$sql_usager = "SELECT prenom
	FROM usager
	WHERE bidsession = '$Bsession_id';";
	$result_usager = mysqli_query($GLOBALS["___mysqli_ston"], $sql_usager) or die("");
	$row_usager = mysqli_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);
}




?>
