Checkbox Problem


I am new to PHP and I am facing a problem. I generated a php form from database with 5 checkboxes on each row. I want to get checkbox values for their respective columns but I am getting the values for the whole checkboxes. I used array for these. Is there anyway to sort this out?? Please help me. This is the code.

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “”>
<html xmlns=“”>
<meta http-equiv=“Content-Type” content=“text/html; charset=utf-8” />
<title>Untitled Document</title>

mysql_connect(“localhost”, “$username”, “$password”);
@mysql_select_db(“$database”) or die( “Unable to select database”);
$query=“SELECT * FROM students”;



<form name=“f1” method=“post” action=“test3.php”>
<table border=“1”>
<th>Student Name</th>
<th colspan=“5”>Attendance</th>
<th>Paid Fees</th>
<td><input type=“hidden” name=“id” id=“id” value=“<? echo $rows[‘id’]; ?>”><? echo $rows[‘id’]; ?></td>
<td><? echo $rows[‘studentname’]; ?></td>
<td><? echo $rows[‘activity’]; ?></td>
<td><input type=“hidden” name=“fees” id=“fees” value=“<? echo $rows[‘fees’]; ?>”><? echo $rows[‘fees’]; ?></td>
<td><input type=“checkbox” name=“find1” value=“<? echo $rows[‘fees’]; ?>”></td>
<td><input type=“checkbox” name=“find2” value=“<? echo $rows[‘fees’]; ?>”></td>
<td><input type=“checkbox” name=“find3” value=“<? echo $rows[‘fees’]; ?>”></td>
<td><input type=“checkbox” name=“find4” value=“<? echo $rows[‘fees’]; ?>”></td>
<td><input type=“checkbox” name=“find5” value=“<? echo $rows[‘fees’]; ?>”></td>

<td><input type=“text” name=“paid” id=“paid”></input></td>
<input type=“submit” name=“submit” value=“Submit”>

What exactly do you mean with this?

Hi Immerse

I am thankful for your interest in this problem. I am preparing a form for attendance. When the checkbox is checked and submitted it must calculate the fees for the attendance for that month and the classes are conducted on all Sundays. For example if the fees is $7/day and if a person comes 3 sundays in a month then the fees is $21. There are 5 checkboxes for each student in a row as there may be 4 or 5 sundays in a month. I used array for checkboxes but it selected all the selected checkboxes in every row. I want to get the attendance individually for each student row. I think now you got the problem. This is the situation. Please help me and ask me if it is not clear.

I think things would be clearer if you post the actual html your php page generates.

But it appears that find1[0] will be the value of the first checkbox in row 1. find1[1] will be the selected value of the first checkbox in row 2 and so on. Bear in mind that the values of only the checked boxes will be sent to your php script.