php - How to calculate Due Fees? -
i want calculate due fees, w.r.t current month. session of schools starts apr, , fees starts apr.
if student not pay fees in apr, may, jun, , paying fees in aug. due fees must apr + may + jun.
but i`m confused how due fees based on current month.
my code:
$current_month = date('m'); $final = 0; for($i='apr'; $i<$current_month; $i++) { $query_run = mysqli_query($conn,"select amount fees_on_class class = '$class'"); while ($num = mysqli_fetch_assoc ($query_run)) { $temp += $num['amount']; } $final = $final + $temp; } mysqli_query($conn,"insert dues(registration_number, due_fees)values('$registration_number','$final')");
code not working , giving 0 (0).
thanks.
alphabetic value in loop using not work want.
for($i='apr'; $i<$current_month; $i++) { }
please make month loop numeric.
for($i='4'; $i<$current_month; $i++) { }
i have not checked whole code, first error can see..
Comments
Post a Comment