我有一个组,组长正在更新组中的成员。角色 ID 为 11 的成员处于待处理状态,我想根据下拉列表中选择的选项更改他们的角色 ID。
这是表格:
<form action='updatePendingMembers.php' method='post' onsubmit='return checkForm()'>
<?php
$pendingMembers = "SELECT m.id, concat(fname, ' ', lname) as mName, email, m.rolesID FROM member m join member_to_groups on m.id = member_to_groups.memberID left join groups on member_to_groups.groupsID = groups.id WHERE m.rolesID = 11 AND groups.memberID = " . $_SESSION['siteMemberId'];
$rsPendingMembers = mysql_query($pendingMembers);
//if(!$rsPendingMembers)
//echo 'the query is: ' . $pendingMembers . '<br/>and the error: ' . mysql_error();
while($get_row = mysql_fetch_assoc($rsPendingMembers)){
?>
<tr>
<td colspan="3" class="Sub_Header">Pending Group members</td>
</tr>
<tr>
<td colspan="3"><span class="Maintext"><?php echo $get_row['mName']?></span>
<select name="rolesID" class="lowermenu" id="rolesID">
<option value="12">Accept</option>
<option value="11">Decline</option>
</select>
<a href="mailto:<?php echo $get_row['email']?>"><span class="lowermenu">send pending member message</span></a></td>
</tr>
<?php } ?>
<td><span class="Sub_Header">
<input name="update_pending_member_button" type="submit" id="update_pending_member_button" value="Update Member">
</span></td>
</form>
这是到目前为止的 updatePendingMembers.php 文件:
<?php
session_start();
include("global.php");
$myQuery1 = "UPDATE member SET rolesID = " . mysql_real_escape_string($_POST['rolesID']) WHERE id = ;
$rs1 = mysql_query($myQuery1);
?>
如何将 id 设置为与被选中的成员以及该特定组中的成员相等?谢谢。