etz Posted April 19, 2007 Share Posted April 19, 2007 if ($num > 0) { // Table header. echo '<form action="attendanceregister2.php" method="post"><table border="1" align="left" cellspacing="1" cellpadding="1"> <tr><td align="center"><b>ID</b></td><td align="left"><b>Position</b></td><td align="left"><b>Name</b></td><td colspan="4" align="center"><font size="3" />Status</td></tr> '; while ($row = mysql_fetch_array($result)) { $bg = ($bg == '#CCFF99' ? '#CCFFff' : '#CCFF99'); echo '<tr bgcolor="' .$bg .'"> <td align="left">' . $row['id'] . '</td><td align="center">' . $row['Position'] . '</td><td align="left">' . $row['Name'] . '</td> <td><input type="radio" name=' . $row['id'] . ' value="1" />Present</td> <td><input type="radio" name=' . $row['id'] . ' value="0" />Absent </td> <td><input type="radio" name=' . $row['id'] . ' value="n/,a" />n/a </td></tr> '; } echo '</table><br>'; mysql_free_result ($result); } else { echo '<p class="error">There are currently no registered users.</p>'; } ?> ....This is an online attendance checking script.For each name here i have three options w/c is present,absent, n/a (done by radio buttons).I'm having a problem on what script will i use to determine which of the three options has been selected for each name.I'm new in programming.please help me.Thaks! Link to comment https://forums.phpfreaks.com/topic/47665-attendance-checking-help/ Share on other sites More sharing options...
lifeson2112 Posted April 19, 2007 Share Posted April 19, 2007 I am pretty new to php also and this is my first time offering help on the forums, so forgive me if I send you in the wrong direction, but shouldn't $row[] be accepting a number? I think you just have to figure out what row the id is in (starting at 0 of course) and use that number in place of 'id'. Link to comment https://forums.phpfreaks.com/topic/47665-attendance-checking-help/#findComment-232782 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.