Question : saving data to text

Hello,
I have the saving section working, the only issue I am having is getting the quotations around the $date call where stringData is being echo'd, here is what I have to this point:

When it saves it saves like this:

<period name=Aug 25th 2010>  
<v>101.1683</v>

I need it to save like this:

<period name="Aug 25th 2010">  
<v>101.1683</v>

I need the quotes around the date for my graph to recognize it.  Can anyone help?
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
<?php
include_once "../connect_to_mysql.php";

$query = "Select Industry, AVG(Current_Value) FROM stock_index";
$result = mysql_query($query) or die(mysql_error());

//Print out results
while($row = mysql_fetch_array($result)){
		$myFile = "_AVG.txt";
		$date = date("M j, Y");
		$fh = fopen($myFile, 'a') or die("can't open file");
		$stringData2 = "\n \n <period name=$date> \n <v>".$row['AVG(Current_Value)']."</v>";
		fwrite($fh, $stringData2);
		echo"$stringData2";
		fclose($fh);
		}
?>

Answer : saving data to text

I think this should work.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
<?php
include_once "../connect_to_mysql.php";

$query = "Select Industry, AVG(Current_Value) FROM stock_index";
$result = mysql_query($query) or die(mysql_error());

//Print out results
while($row = mysql_fetch_array($result)){
		$myFile = "_AVG.txt";
		$date = date("M j, Y");
		$fh = fopen($myFile, 'a') or die("can't open file");
		$stringData2 = "\n \n <period name=\"$date\"> \n <v>".$row['AVG(Current_Value)']."</v>";
		fwrite($fh, $stringData2);
		echo"$stringData2";
		fclose($fh);
		}
?>
Random Solutions  
 
programming4us programming4us