您好我正在尝试插入选定客户的复选框数据是/否。选定的客户(从数据库中检索谁的值)如果选中是,则 Y 将插入表字段中,如果选中否,则将 N 插入表字段中。我找不到这样做的解决方案,试过了!
提前感谢您的帮助。这是我到目前为止所拥有的;
<table width="400" border="1" bordercolor="#598DD5">
<tr>
<td bordercolor="#598DD5" bgcolor="#598dd5"><span class="style1">Projects</span></td>
<td bordercolor="#598DD5" bgcolor="#598dd5"><span class="style1">Hot Project</span>
</td>
</tr>
<tr>
<td bordercolor="#598DD5"><select name="customer">
<option value="">--</option>
<?php
$sql = "SELECT * FROM ".$SETTINGS["data_table"]." GROUP BY customer ORDER BY customer";
$sql_result = mysql_query ($sql, $connection ) or die ('request "Could not execute SQL query" '.$sql);
while ($row = mysql_fetch_assoc($sql_result)) {
echo "<option value='".$row["customer"]."'".($row["customer"]==$_REQUEST["customer"] ? " selected" : "").">".$row["customer"]."</option>";
} ?>
</select></td>
<td bordercolor="#598DD5">
<div align="center">
Yes <input type="checkbox" name="hotproject" value="Y" <?php if( isset( $_GET['customer'] ) ){ ?> checked="checked" <?php } ?> />
No <input type="checkbox" name="hotproject" value="N" <?php if( isset( $_GET['customer'] ) ){ ?> checked="checked" <?php } ?> /></div> </td>
</tr>