...

View Full Version : adding radio buttons



puja
04-28-2006, 07:47 PM
hi
i want to add a column for radio buttons at the end of my table but im not sure how 2 do it.
my table looks like:




echo '<table align = "center" border = "1" cellspacing = "0" cellpadding = "5">
<tr>
<td align="left"><b>Type</b></td>
<td align="left"><b>Sleeps</b></td>
<td align="left"><b>Board</b></td>
<td align="left"><b>Description</b></td>
<td align="left"><b>Pets Allowed</b></td>
</tr>
';

while ($row = mysql_fetch_array($result, MYSQL_ASSOC)){
echo '
<tr>
<td align="left">'. $row['type']. '</td>
<td align="left">'. $row['sleeps']. '</td>
<td align="left">'. $row['board']. '</td>
<td align="left">'. $row['description']. '</td>
<td align="left">'. $row['pets_allowed']. '</td>
</tr>
';
}
echo '</table>';



has anybody got any ideas how i could do it?
thanks

chump2877
04-29-2006, 01:45 AM
echo '<form name="form1" action="#" method="post">';

echo '<table align="center" border="1" cellspacing="0" cellpadding="5">
<tr>
<td align="left"><b>Type</b></td>
<td align="left"><b>Sleeps</b></td>
<td align="left"><b>Board</b></td>
<td align="left"><b>Description</b></td>
<td align="left"><b>Pets Allowed</b></td>
<td></td>
</tr>
';

$query = "SELECT * FROM table";
$result = mysql_query($query);

$x=0;

while ($row = mysql_fetch_assoc($result))
{
echo '
<tr>
<td align="left">'. $row['type']. '</td>
<td align="left">'. $row['sleeps']. '</td>
<td align="left">'. $row['board']. '</td>
<td align="left">'. $row['description']. '</td>
<td align="left">'. $row['pets_allowed']. '</td>
<td><input type="radio" name="button'.$x.'" value="val1"> <b>Value #1</b> <input type="radio" name="button'.$x.'" value="val2"> <b>Value #2</b></td>
</tr>
';

$x++;
}

echo '</table>';

echo '<input type="submit" value="Submit"></form>';



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum