<?
$query = $_GET['query'];
if ($query != "")
	{
$host = "localhost";
$user = "mmaaaco_ksecor";
$pass = "hamilton";
$dbname = "mmaaaco_mydb";

$db = @mysql_connect($host, $user, $pass);
$result = @mysql_select_db($dbname,$db);

echo "<table border = \"1\"><tr><th>Store</th><th>Sales</th></tr>";
$sql = mysql_query("SELECT * FROM stores");
while ($row = mysql_fetch_array($sql))
	{
	echo "<tr><td>$row[store]</td><td>$row[sales]</td></tr>";
	}
echo "</table>";


$query = $_GET['query'];


$sql = mysql_query("SELECT $query(sales) FROM stores");

while ($row = mysql_fetch_array($sql)) {
echo "$query is $row[0]  <br />";
}
}
else
{
Echo "Enter a Query!";
}

?>
