<?php print "<?"; ?>xml version="1.0" encoding="utf-8" <?php print "?>"; 
include("conexion.php");
$query = "SELECT * FROM Sell, Stock WHERE Sell.stock = Stock.id";
$answersell = mysql_query($query);
$query = "SELECT * FROM Buy, Stock WHERE Buy.stock = Stock.id";
$answerbuy = mysql_query($query);
$query = "SELECT now() AS time FROM Sell";
$answernow = mysql_query($query);
$rownow = mysql_fetch_array($answernow);
?>
<rss version="2.0">
<channel>
 <title>Virtual Trade</title>
 <link>http://localhost/</link>
 <description>Virtual Trade is a simulation of the real Trade.</description>
 <language>en-uk</language>
<?
while($row = mysql_fetch_array($answersell)){
?>
<item>
 <title>Sells</title>
 <link>http://localhost/</link>
 <description>
 <? 
 	echo "Ticker: ".$row['ticker'];
	echo "&lt;br/&gt;";
 	echo "Price: ".$row['price'];
	echo "&lt;br/&gt;";
	echo "Volume: ".$row['volume']; 
 	echo "&lt;br/&gt;";
 ?>
</description>
 <pubDate>
 <?
	echo $rownow["time"];
 ?>	
</pubDate>
 <guid>http://localhost/</guid>
</item>
<?
}
while($row = mysql_fetch_array($answerbuy)){
?>
<item>
 <title>Buys</title>
 <link>http://localhost/</link>
 <description>
 <? 
 	echo "Ticker: ".$row['ticker'];
	echo "&lt;br/&gt;";
 	echo "Price: ".$row['price'];
	echo "&lt;br/&gt;";
	echo "Volume: ".$row['volume']; 
 	echo "&lt;br/&gt;";
 ?>
</description>
 <pubDate>
 <?
	echo $rownow["time"];
 ?>	
</pubDate>
 <guid>http://localhost/</guid>
</item>
<?
}
?>
</channel>
</rss>
