Im creating a table that will display a students name and service hours read in from a database. Then in each row of the table i need to have a set of radio boxes or check boxes which is easier.
The first is to insert "L, I or , B" for exhibiting leadership, initiative, or both.
The second and more importantly is to insert 0 or 1 into the database depending on whether or not it is verified.
while ($row = mysql_fetch_array($result)) {
$student = mysql_query("SELECT * FROM student WHERE id = $row[student]. ");
$row2 = mysql_fetch_array($student);
$agency = mysql_query("SELECT * FROM agencies WHERE id = $row[agency]. ");
$row3 = mysql_fetch_array($agency);
echo "<tr>
<td>" . $row2['firstname'] . "</td>
<td>" . $row2['lastname'] . "</td>
<td>" . $row2['grade'] . "</td>
<td>" . $row['date'] . "</td>
<td>" . $row3['name'] . "</td>
<td>" . $row['servicehours'] . "</td>
<td>" . $row['notes'] . "</td>
<td>" ?> <input type="checkbox" name="Leadership" value="L"> Leadership<br>
<input type="checkbox" name="Initiative" value="I" > Initiative<br>
<input type="checkbox" name="Both" value="B" > Both<br>
<td> <input type="radio" name="verification" value="verified" /> Verify <br/>
<input type="radio" name="verification" value="not" /> Reject <?php "</td>";
$i++;
echo "</tr>";
This creates all draws all the information correctly, and displays it. My problem is ONE i don't understand how to submit the values into the database when they are checked off.
And TWO they don't act as independent sets of radios or checkboxes. So for the radios, I can only click one option, even if there are 5 sets displayed
Help with this would be extremely appreciated.email me if you need more specific details: [email protected]
The first is to insert "L, I or , B" for exhibiting leadership, initiative, or both.
The second and more importantly is to insert 0 or 1 into the database depending on whether or not it is verified.
while ($row = mysql_fetch_array($result)) {
$student = mysql_query("SELECT * FROM student WHERE id = $row[student]. ");
$row2 = mysql_fetch_array($student);
$agency = mysql_query("SELECT * FROM agencies WHERE id = $row[agency]. ");
$row3 = mysql_fetch_array($agency);
echo "<tr>
<td>" . $row2['firstname'] . "</td>
<td>" . $row2['lastname'] . "</td>
<td>" . $row2['grade'] . "</td>
<td>" . $row['date'] . "</td>
<td>" . $row3['name'] . "</td>
<td>" . $row['servicehours'] . "</td>
<td>" . $row['notes'] . "</td>
<td>" ?> <input type="checkbox" name="Leadership" value="L"> Leadership<br>
<input type="checkbox" name="Initiative" value="I" > Initiative<br>
<input type="checkbox" name="Both" value="B" > Both<br>
<td> <input type="radio" name="verification" value="verified" /> Verify <br/>
<input type="radio" name="verification" value="not" /> Reject <?php "</td>";
$i++;
echo "</tr>";
This creates all draws all the information correctly, and displays it. My problem is ONE i don't understand how to submit the values into the database when they are checked off.
And TWO they don't act as independent sets of radios or checkboxes. So for the radios, I can only click one option, even if there are 5 sets displayed
Help with this would be extremely appreciated.email me if you need more specific details: [email protected]