我正在使用while
循环并mysql_fetch_array
在数据库的页面上显示信息。如何为页面上回显的某些单选按钮元素提供变量名称,然后在$_POST
提交表单时将这些变量名称用于单选按钮作为变量?
这是代码:
session_start();
include 'acdb.php';
$prodid = $_SESSION['prodid'];
$e = "SELECT * FROM Images WHERE product_id=$prodid AND active='yes'";
$e_result = mysql_query($e,$connection) or die ('Could not get the list of all Images for this Product and Service');
$amount = mysql_num_rows($e_result);
while ($e_data = mysql_fetch_array($e_result)) {
echo "<img src='images/thumbnails/" .$e_data[1]. "' border='0'>";
echo "<label class='sel-photo'>DISPLAY PICTURE:</label> <input type='radio' name='{radio" .$e_data[0]. "}' value='1'>";
echo "<br>";
echo "<label class='sel-photo'>DO NOT DISPLAY PICTURE:</label> <input type='radio' name='{radio" .$e_data[0]. "}' value='0' checked>";
}