require('../chart/chart.php');
$id = $_GET['id'];
$table = "spectra";
$link = mysql_connect("localhost", "lab.info", "incognito")
or die("Could not connect: " . mysql_error());
mysql_select_db('gislab', $link)
or die ('Can\'t use gislab-todo : ' . mysql_error());
$query = "SELECT * FROM $table WHERE $table.`id` = $id LIMIT 1;";
$result = mysql_query($query) or die("Invalid query: " . mysql_error());
$x = explode(";", mysql_result($result,0,"x"));
$y = explode(";",mysql_result($result,0,"y"));
$j = 0;
echo "x,y
";
WHILE ($j < count($x))
{
echo $x[$j] . "," . $y[$j] . "
";
$j = $j + 1;
}
?>