include("conf.php");
$q = "select id,tid dato, weight from weight where active = 'yes' and userid = 3 order by id";
$res = mysql_query($q,$connection);
if (!$res) { echo "fejl ved query: ".mysql_error(); die(); }
//Define some data
$data_array = array();
$minx = 0;
$maxx = 0;
$miny = 70;
$maxy = 115;
$startweight = 0;
?>
Dato |
|
Vægt |
while ($arr = mysql_fetch_array($res)) {
if (!$minx) { $minx = $arr["dato"]; }
if (!$startweight) { $startweight = $arr["weight"]; }
$maxx = $arr["dato"];
$endweight = $arr["weight"];
echo " \n";
#echo " ".$arr["id"]." | \n";
#echo " | ";
echo " ".$arr["dato"]." | \n";
echo " | ";
echo " ".sprintf("%01.1f",$arr["weight"])." | \n";
echo " \n";
}
?>
$result = $startweight - $endweight;
echo "diff: ".sprintf("%01.1f",$result)." kg \n";
?>
|
|
|