I'm sending vars from a form:
<FORM METHOD = "post" ACTION="docalc.php">
Here is a SELECT made....and a WHILE ...{....
and eventually listing as many forms as there are entries in the db:
$i=1;
<INPUT TYPE = "TEXT" NAME = "<? echo "fromdate$i" ?>" VALUE = "<? echo "$indate";?> "
<INPUT TYPE = "TEXT" NAME = "<? echo "todate$i" ?>" VALUE = "<? echo ($year -1);?>"
$i++ ;
}
?>
<INPUT TYPE="SUBMIT" VALUE="send">
The docalc.php should act on the vars $fromdate and $todate,
$result = mysql_query ("SELECT SUM(Amortering) AS total FROM Skatteuppg WHERE (År>=$fromdate$i AND År <=$todate$i )");
list ($total) = mysql_fetch_row($result);
but it doesn't work the way I have named them in the form.