<?php
include_once "connect_to_mysql.php";
$sql = mysql_query("SELECT Full_Name, Current_Value FROM stock_index");
$todayDate = $_POST['todayDate'];
while ($fila = mysql_fetch_array($sql)) {
$Full_Name = $fila['Full_Name'];
$Current_Value = $fila['Current_Value'];
$myFile = "indices/Transaction_History".$Full_Name.".txt";
$fh = fopen($myFile, 'a') or die("can't open file");
$stringData = "\n \n Date: $todayDate \n Name: $Full_Name \n Value: $Current_Value";
fwrite($fh, $stringData);
fclose($fh);
}
?>
|