Forum Moderators: coopster
echo "<table cellspacing='10' border='0' cellpadding='0' width='100%'>";
echo "<tr><td width='20'></td>
<td>Ad Name</td></tr>";
while ($row = mysql_fetch_array($result,MYSQL_ASSOC))
{
extract($row);
echo "<tr><td><input name='vAd' type='radio' value='$adID'></td>
<td>{$row['adName']}</td></tr>";
}
echo "<tr><td colspan='2' width='10'>
<table cellspacing='10' border='0' cellpadding='0' width='100%'>
<tr><td><a href='edit_add.php?id=$adID'>Edit</a></td></tr></table>
</td></tr></table>";
I would like to pass the value $adID from the radio buttons to this link here: <a href='edit_add.php?id=$adID'>Edit</a>
But no matter what radio button I choose, when I click the Edit link, the ID doesn't change. Any sugestions? Thanks.
However, if I put all my code into the while structure like this:
while ($row = mysql_fetch_array($result,MYSQL_ASSOC))
{
echo "<table cellspacing='10' border='0' cellpadding='0' width='100%'>";
echo "<tr><td width='20'></td>
<td>Ad Name</td></tr>";
extract($row);
echo "<tr><td><input name='vAd' type='radio' value='$adID'></td>
<td>{$row['adName']}</td></tr>";
echo "<tr><td colspan='2' width='10'>
<table cellspacing='10' border='0' cellpadding='0' width='100%'>
<tr><td><a href='edit_add.php?id=$adID'>Edit</a></td></tr></table>
</td></tr></table>";
}
it will work, the id will change but it will also generate a new table everytime, and I don't want this.