第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

如何從數(shù)據(jù)庫中捕獲 ID 以更新狀態(tài)?

如何從數(shù)據(jù)庫中捕獲 ID 以更新狀態(tài)?

PHP
肥皂起泡泡 2021-10-15 10:37:51
我正在嘗試通過單擊更新按鈕將狀態(tài)從待處理更新為“已批準(zhǔn)”。但是,當(dāng)我單擊按鈕時(shí),它沒有響應(yīng)并更改狀態(tài)。但是,如果我對 ID 進(jìn)行硬編碼,則狀態(tài)可以更新。如何從數(shù)據(jù)庫中獲取 ID 捕獲并在單擊按鈕后更新狀態(tài)?//edit1.php:<?php    $con= mysqli_connect('127.0.0.1','root','');    if(!$con)    {        echo 'Not Connected To Server';    }    if(!mysqli_select_db($con,'satsform1'))    {        echo 'Database Not Selected';    }    $ID = 'ID';    $sql = "update handover set status= 'Approved' where ID = '$ID'";    if(!mysqli_query($con,$sql))    {        echo 'Not Submitted';    }    else    {        echo "<meta http-equiv='refresh' content='0;url=index3.php'>";    }?><?php//fetch3.php$connect = mysqli_connect('127.0.0.1','root','', 'satsform1');$output = '';if(isset($_POST["query"])){ $search = mysqli_real_escape_string($connect, $_POST["query"]); $query = "  SELECT * FROM handover   WHERE name LIKE '%".$search."%'  OR staffno LIKE '%".$search."%'   OR date LIKE '%".$search."%'  OR email LIKE '%".$search."%'  OR mobno LIKE '%".$search."%'  OR roles LIKE '%".$search."%'  OR location LIKE '%".$search."%'  OR flightno LIKE '%".$search."%'  OR flightdate LIKE '%".$search."%'  OR seatno LIKE '%".$search."%'  OR class LIKE '%".$search."%' ";}else{ $query = "  SELECT * FROM handover ORDER BY ID ";}$result = mysqli_query($connect, $query);if(mysqli_num_rows($result) > 0){ $output .= '  <div class="table-responsive">   <table class="table table bordered">    <tr>     <th>ID</th>     <th>Staff Name</th>     <th>Staff Number</th>     <th> Status </th>    </tr> '; while($row = mysqli_fetch_array($result)) {  $output .= '   <tr>    <td>'.$row["ID"].'</td>    <td>'.$row["name"].'</td>    <td>'.$row["staffno"].'</td>    <td>'.$row["status"].'</td>    // this is the update button where use the edit1.php to update the status by ID    <td> <form action="edit1.php" method="GET">            <button type="submit">update </button>        </form>    </td>   </tr>   '; } echo $output;}else{ echo 'Data Not Found';}?>我希望輸出能夠在單擊更新按鈕后將狀態(tài)更新為“已批準(zhǔn)”到數(shù)據(jù)庫中。
查看完整描述

1 回答

  • 1 回答
  • 0 關(guān)注
  • 192 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號