我想我的问题是在隐藏字段中检索id
while( $row = mysqli_fetch_assoc($result)){
echo "<tr><td><form action='workshopreq.php' method='POST'> <td=width='5%'><input type='checkbox' name='foo' value='bar1'/> </td>"."<td>". $row["wID"]. "</td><td>" . $row["wName"]. "</td><td width='10%'>" . $row["services" ]. "</td><td>" . $row["other"]. "</td><td width='5%'>" . $row["area"]."</td>";
echo "<td><input type='hidden' name='status' value='".$row["wID"]."'><input type='submit' name='conf' value='confirm'></td><td><input type='submit' name='decline' value='decline'></td></form></tr>";
}
if(isset($_POST['conf'])){
$sql1= "INSERT INTO acceptedWS(wName, wEmail, wPass, services, other, Workshop, area, starthr, endhr,clock1,clock2)
SELECT wName, wEmail, wPass, services, other, Workshop, area, starthr, endhr,clock1,clock2 FROM Workshop where Workshop.wID='".$row["wID"]."'";
$res= mysqli_query($conn,$sql1);
}
if(isset($_POST['decline'])){
//delete from database
}
echo "</table>"; }
提前谢谢!
暂无答案!
目前还没有任何答案,快来回答吧!