我制作了一个从 mysql 数据库获取数据并放入 html 表单的表。但是,我一直在尝试在每一行上制作按钮,然后这些按钮的变量值等于行中的两个值。这是我的代码:
$html_table = '<table border="1" cellspacing="0" cellpadding="2"><th>Company Symbol </th><th>Amount </th><th>Actual Stockprice </th><th>Total Value </th><th> Sell? </th><tr>';
while ($row = mysql_fetch_array($result))
{
$actstock = "\n".$json_output['l'];
$company = $row['company'];
$totalvalue = $row['amount']*$actstock;
$radio="<input type='radio' value='$company' name='symbol' />";
$dollar = "$";
$html_table .= '<tr><td>' .$row['company']. '</td><td>'
.$row['amount'].'</td><td>'
.$dollar.$actstock. '</td><td>' .$dollar.$totalvalue.'</td><td>' .$radio. '</td></tr>';
}
然后是一个按钮,然后
$symbol = $_POST['symbol'];
echo $symbol;
任何帮助都会很棒,谢谢。