I'm doing a search producing several prefilled instances of a form. The user checks the forms before sending them to the script below. If only one form is checked it works fine. If two forms are checked I get nothing whatsoever. Any suggestions?
I'm doing the same Select statements on both pages. Thus all I need to do here is to see which instances of $i is checked.The $fromdate$i and $todate$i vars are passed from the forms.
$i=1;
while ($row = mysql_fetch_array ($xxx)) {
if (${"form$i"} == "on") {
$result = mysql_query ("SELECT SUM(mycol) AS total FROM mytbl WHERE (col>='${"fromdate$i"}' AND col <='${"todate$i"}' )");
list ($total) = mysql_fetch_row($result);
$usersum = ($total * $y)/100 ;
echo sprintf('%d', $usersum);
}
$i++;
}