dongyuan7110 2014-08-21 00:28
浏览 7

更新检索的数据

Hi there im in the process of making a page to approve and deny names in a database, I currently have it so it finds an pulls the pending requests im looking for now i wanna know how to update the row once i click approve or deny.

the values it needs to update is the NameState column to either ("approved") or ("REJECTED")

there can be any where from 1 to 100 names at a time.

Thanks Ryan

 $DB_HOST = "IP";
        $DB_USER = "user";
        $DB_PASS = "Pass";
        $DB_DTBS = "DB";
        mysql_connect($DB_HOST, $DB_USER, $DB_PASS) or die(mysql_error()); // Connect to database server(localhost) with username and password.
        mysql_select_db($DB_DTBS) or die(mysql_error()); // Select registration database.

        $search = mysql_query('SELECT * FROM TABLE WHERE `NameState` = \'(\"PENDING")\'') or die(mysql_error()); 

        $match  = mysql_num_rows($search);


        if($match > 0){
            echo "<table border='1'>
                    <tr>
                    <th>ID</th>
                    <th>Current Name</th>
                    <th>Requested Name</th>
                    <th>Approve or Deny</th>
                    </tr>";

            while($row = mysql_fetch_array($search)) {
                echo "<tr>";
                echo "<td>" . $row['object_id'] . "</td>";
                echo "<td>" . $row['Name'] . "</td>";
                echo "<td>" . $row['WishName'] . "</td>";
                echo '<td> <form method="post" action=<?php echo Approve:<input type="radio" value="Approve" name="name"> Deny:<input type="radio" value="Deny" name="name"><br /> </td>';
                echo "</tr>";
            }

            echo "</table>";

            echo '<input type="Submit" value="Submit" name="Submit"> </form>';

        } else {
            echo("No Names to Approve");
        }

    ?>
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
    • ¥15 个人网站被恶意大量访问,怎么办
    • ¥15 Vue3 大型图片数据拖动排序
    • ¥15 Centos / PETGEM
    • ¥15 划分vlan后不通了
    • ¥15 GDI处理通道视频时总是带有白色锯齿
    • ¥20 用雷电模拟器安装百达屋apk一直闪退
    • ¥15 算能科技20240506咨询(拒绝大模型回答)
    • ¥15 自适应 AR 模型 参数估计Matlab程序
    • ¥100 角动量包络面如何用MATLAB绘制