<?
//ini_set("memory_limit","1024M");
include ('function.php');
//Written by Jing Gao
//This script is called by  Cytoscape metabolomics plugin to query humdb database 
$db="humdb";
//connect to database server with "userMimiCytoPlugin" account
conn_db();
mssql_select_db($db);
$ret="";
$query ="exec dbo.cmpdLookupSP";
$results=mssql_query($query)or die("Sorry, \"$query\" failed.");
$len=mssql_num_fields($results);
print "<html><body><h1 align=center><font color=blue>Compound </font></h1><table border=1><tr><th><font color=brick>Compound ID </font></th><th><font color=brick>Name Type</font></th><th><font color=brick>Compound Name</font></th></tr>";
while ($myrow = mssql_fetch_array($results)){
 	//print "<tr><td><a href='http://mimitest.ncibi.org/MimiWeb/compound-details-page-front.jsp?cid=$myrow[0]'>$myrow[0]</a></td><td>$myrow[1]</td><td>$myrow[2]</td></tr>";
	print "<tr><td><a href='http://mimi.ncibi.org/MimiWeb/compound-details-page-front.jsp?cid=$myrow[0]'>$myrow[0]</a></td><td>$myrow[1]</td><td>$myrow[2]</td></tr>";
}

mssql_close();
print"</table></body></html>";
?>
