總共有五個會員
$SQLadmin = mysql_query("SELECT * FROM `admin`
");
<form action="admin_update?type=permissions" method="post" id="saveform">
<table width="300" border="0" cellspacing="10" cellpadding="10" align="center" class="tab">
<tr>
<td width="50%">ID</td>
<td width="50%">Permissions</td>
</tr>
<? while ($row = mysql_fetch_array($SQLadmin)){?>
<tr>
<td><? echo $row['id'];?></td>
<td>
<select name="permissions" class="p100">
<option value="0" <? if($row['permissions']==0){echo 'selected';}?>>0</option>
<option value="10" <? if($row['permissions']==10){echo 'selected';}?>>10</option>
<option value="20" <? if($row['permissions']==20){echo 'selected';}?>>20</option>
<option value="30" <? if($row['permissions']==30){echo 'selected';}?>>30</option>
<option value="40" <? if($row['permissions']==40){echo 'selected';}?>>40</option>
<option value="50" <? if($row['permissions']==50){echo 'selected';}?>>50</option>
<option value="60" <? if($row['permissions']==60){echo 'selected';}?>>60</option>
<option value="70" <? if($row['permissions']==70){echo 'selected';}?>>70</option>
<option value="80" <? if($row['permissions']==80){echo 'selected';}?>>80</option>
<option value="90" <? if($row['permissions']==90){echo 'selected';}?>>90</option>
<option value="100" <? if($row['permissions']==100){echo 'selected';}?>>100</option>
</select>
</td>
</tr>
<? }?>
<tr>
<td colspan="2" align="right"><button id="savebtn" class="savebtn" type="submit">Save</button></td>
</tr>
</table>
</form>
admin_update
if($type=='permissions')
{
$permissions = $_POST['permissions'];
$SQL = mysql_query("UPDATE `admin` SET
`permissions` = '".$permissions."'
");
echo '成功';
}
共有五個會員,這五個會員都有permissions值
怎樣才可以編輯會員的permissions數據?
每個permissions都是獨立
我這樣寫會沒辦法運作
是哪裡有問題?
没见过select写的这么感性:
0.0 懵逼 什么叫逻辑死?
你需要把 update语句打印一下 看看问题出在哪里
为什么没看到where呢,
UPDATE 'admin' SET 'permissions' = '".$permissions where ID='会员ID';