duanlin1931 2017-08-08 04:03
浏览 80

使用php在oracle数据库中没有更新数据

i am using oracle with php. I have inserted data and now wants to update the column of availability of user. I am using the code given below but I am unable to update data. Data remains the same. Please help me.

    <?php
    if(isset($_POST['available']))
    {
        var_dump($_POST);
       print_r($_POST);
        echo("in available");
        session_start();
        $user = $_SESSION["username"];
        include('connect.php');
        $sql = oci_parse($conn,"select * from userM where user_name = '$user'");
       $result =  oci_execute($sql);

       while(($row = oci_fetch_array($sql,OCI_BOTH)) != false )
      {
         $p_No = $row[0];
         $full_Name = $row[1];
         $user_name = $row[2];
         $email = $row[3];
         $department = $row[4];
          $desig = $row[5];
        }
        $avail = 1;
        $sql1 = "update userM where user_name = '$user'"."set (:p_No, :full_Name, :user_name, :email, :department, :designation, :avail)";
           $compiled = oci_parse($conn,$sql1);
          oci_bind_by_name($compiled, ':p_No', $p_No);
          oci_bind_by_name($compiled, ':full_Name', $full_Name);
          oci_bind_by_name($compiled, ':user_name', $user_name);
          oci_bind_by_name($compiled, ':email', $email);
          oci_bind_by_name($compiled, ':department', $department);
          oci_bind_by_name($compiled, ':designation', $desig);
          oci_bind_by_name($compiled, ':avail', $avail);
          oci_execute($compiled);
          oci_close($conn);
         header("location:register.php?msg=avail");
    }
   ?>
  • 写回答

0条回答

    报告相同问题?

    悬赏问题

    • ¥20 ML307A在使用AT命令连接EMQX平台的MQTT时被拒绝
    • ¥20 腾讯企业邮箱邮件可以恢复么
    • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?
    • ¥15 错误 LNK2001 无法解析的外部符号
    • ¥50 安装pyaudiokits失败
    • ¥15 计组这些题应该咋做呀
    • ¥60 更换迈创SOL6M4AE卡的时候,驱动要重新装才能使用,怎么解决?
    • ¥15 让node服务器有自动加载文件的功能
    • ¥15 jmeter脚本回放有的是对的有的是错的
    • ¥15 r语言蛋白组学相关问题