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条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 如何在scanpy上做差异基因和通路富集?
    • ¥20 关于#硬件工程#的问题,请各位专家解答!
    • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
    • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
    • ¥30 截图中的mathematics程序转换成matlab
    • ¥15 动力学代码报错,维度不匹配
    • ¥15 Power query添加列问题
    • ¥50 Kubernetes&Fission&Eleasticsearch
    • ¥15 報錯:Person is not mapped,如何解決?
    • ¥15 c++头文件不能识别CDialog