<?php
$q=$_GET["q"];

if($q==1)
$compname='YHOO';
if($q==2)
$compname='GOOG';
if($q==3)
$compname='MSFT';
if($q==4)
$compname='STLD';
if($q==5)
$compname='AMZN';
if($q==6)
$compname='BAC';
if($q==7)
$compname='AAPL';
if($q==8)
$compname='ACN';
if($q==9)
$compname='BARC.L';
if($q==10)
$compname='C';
if($q==11)
$compname='CCE';
if($q==12)
$compname='DELL';
if($q==13)
$compname='DIS';
if($q==14)
$compname='AMD';
if($q==15)
$compname='EBAY';
if($q==16)
$compname='F';
if($q==17)
$compname='GE';
if($q==18)
$compname='GM';
if($q==19)
$compname='HPQ';

$con = mysql_connect('localhost', 'root', 'pulsar99');
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("drupalnew", $con);

$sql="SELECT * FROM stock1 WHERE symbol = '".$compname."'";

$result = mysql_query($sql);

echo "<table border='1'>
<tr>
<th>idx</th>
<th>symbol</th>
<th>lastval</th>
<th>Tdate</th>
<th>ttime</th>
<th>change</th>
<th>openval</th>
<th>maximum</th>
<th>minimum</th>
<th>volume</th>
</tr>";

while($row = mysql_fetch_array($result))
  {
  echo "<tr>";
  echo "<td>" . $row['idx'] . "</td>";
  echo "<td>" . $row['symbol'] . "</td>";
  echo "<td>" . $row['lastval'] . "</td>";
  echo "<td>" . $row['Tdate'] . "</td>";
  echo "<td>" . $row['ttime'] . "</td>";
 echo "<td>" . $row['change'] . "</td>";
  echo "<td>" . $row['openval'] . "</td>";
  echo "<td>" . $row['maximum'] . "</td>";
  echo "<td>" . $row['minimum'] . "</td>";
  echo "<td>" . $row['volume'] . "</td>";
  echo "</tr>";
  }
echo "</table>";

mysql_close($con);
?>