An issue with radio buttons

Hi guys. First off, im not entirely sure whether this is the right forum but because the radio buttons are related to php i figured it was okay(sorry if its not! :s)
So i have a table where the <tbody> is populated by data in php. a row has 4 columns: name, unconfirmed, attending and unattending. the last 3 columns are radio buttons which are echoed. the problem is that the radio buttons is not acting as i thought it would. for example for the first row unconfirmed is clicked then for the second row attending is clicked then for the third row attending is also clicked but then the second rows radio button is unclicked(like the indicator moves from second row to third row). how do i get around this?


<table class="rsvp-guest-table">
			<thead>
				<tr>
					<th style="width:100px">Guests</th>
					<th>Unconfirmed</th>
					<th>Attending</th>
					<th>Unattending</th>
				</tr>
			</thead>
			<tbody>
					<?php
							require "connection.php";
							
							$check = mysql_query("SELECT salutation,fname,lname FROM contact") or die(mysql_error());
							if(mysql_num_rows($check) > 0)
							{
								while($row = mysql_fetch_array($check))
								{
									$salutation = $row['salutation'];
									$firstname = $row['fname'];
									$lastname = $row['lname'];

this is where the radio buttons are echoed


									echo
									"<tr>
										<td>$salutation $firstname $lastname</td><td><input type='radio' name='unconfirmed' class='radio' value='unconfirmed'></td><td><input type='radio' name='attending' class='rad' value='attend'></td><td><input type='radio' name='unattending' class='radi' value='notattend'></td>
									</tr>";
								}
							}	
							else
								{
									echo
									"<tr>
										<td colspan='4'>Choose an Event from the list.</td>
									</tr>";
								}
						?>
				</tbody>
		</table>

any help is much appreciated.

It’s not really clear what is going on here, but one thing I’d say is that normally, with radio buttons that are part of the same group (that is, one or the other is to be chosen), they should all have the same name, and just different values to distinguish them. E.g.

<tr>
    <td>G'day Mate</td>
    <td><input type='radio' name='[COLOR="#FF0000"]attending[/COLOR]' class='radio' value='[COLOR="#0000CD"]unconfirmed[/COLOR]'></td>
    <td><input type='radio' name='[COLOR="#FF0000"]attending[/COLOR]' class='rad' value='[COLOR="#0000CD"]attend[/COLOR]'></td>
    <td><input type='radio' name='[COLOR="#FF0000"]attending[/COLOR]' class='radi' value='[COLOR="#0000CD"]notattend[/COLOR]'></td>
</tr>

its okay :slight_smile: thanks for the reminder. i keep forgetting about the names thing with checkboxes and radiobuttons.