So I'm trying to help a friend out by writing his guild an attendance tracker for raiding and whatnot. Right now my concept is to do a select * from the user column, and make a checkbox for each user, assuming that person showed up to raid, it would pass a "1" through the form, and their raid attendance would be incremented by 1. On the users page the overall attendance would be calculated as (raidAtt / raidsTotal)*100 (since joining).
My issue right now is that I don't really know how to get all this information passed using a single loop...
Right now my code is something like this:
<form action="raidattend.php" method="post">
<?php
mysql_connect("$database",$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT * FROM attend WHERE UserName = $v_member ORDER BY date desc";
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
?>
<table>
<tr>
<th>Member</th>
<th>Attended?</th>
</tr>
<?php
$i=0;
while ($i < $num) {
$f1=mysql_result($result,$i,"UserName");
}
<tr>
<td><?php echo $f1; ?></td><td input type="checkbox" checked value="1">
And that's where I ran into issues. I'm not sure how to pass each user and the result of the checkbox back to the database. Once I understand how to do that it's just as simple as incrementing, but I'm pretty lost.
Thanks for any help!
Edit: To clarify, what I'm unsure of is how to break it up so each member gets updated, I understand that I need to use a submit and all that.
Edit 2: Stray }