更新和删除语句不从PHP运行

时间:2016-06-06 22:44:01

标签: php oracle

我希望你能帮助我,我在php方面有点新,而且我遇到一些不能从php运行的语句的麻烦,我有一些函数在我的数据库中执行一些更新或删除语句但是我遇到了这两个似乎没有运行的函数的问题,这是我的代码:

public function delete_roles($ubuser9) {
    $query = "DELETE FROM WFROLES1 WHERE WFUSRCOD=:ubuser9_bv";
    $stid = oci_parse($this->conn, $query);
    oci_bind_by_name($stid, ':ubuser9_bv', $ubuser9);
    oci_execute($stid);
    return $stid;
}


public function delete_sol_suc($ubuser10) {
    $query = "DELETE FROM WFUSERS1 WHERE WFUSRCOD=:ubuser10_bv";
    $stid = oci_parse($this->conn, $query);
    oci_bind_by_name($stid, ':ubuser10_bv', $ubuser10);
    oci_execute($stid);
    return $stid;
}

我有类似的功能,删除或更新其他表中的字段并运行没有问题,例如这些:

    public function delete_perfiles($ubuser4) {
    $query = "DELETE FROM PRFU00 WHERE UBUSER=:ubuser4_bv";
    $stid = oci_parse($this->conn, $query);
    oci_bind_by_name($stid, ':ubuser4_bv', $ubuser4);
    oci_execute($stid);
    return $stid;
}

我用以下方式调用另一个php文件中的函数:

   require_once("Includes/db.php");
   VacasDB::getInstance()->update_sucydatos($_SESSION['ubuser']);
   VacasDB::getInstance()->update_cajytes($_SESSION['ubuser']);
   VacasDB::getInstance()->update_espatrab($_SESSION['ubuser']);
   VacasDB::getInstance()->delete_perfiles($_SESSION['ubuser']);    
   VacasDB::getInstance()->insert_cesado($_SESSION['ubuser']);
   $stid = VacasDB::getInstance()->get_tipocar($_SESSION['ubuser']);
   while ($row=oci_fetch_array($stid)) 
   {
      $_SESSION['tipo']=$row["SNGU01TIP"];
   }
  if ($_SESSION['tipo']==1 || $_SESSION['tipo']==12 || $_SESSION['tipo']==13           || $_SESSION['tipo']==14 || $_SESSION['tipo']==15 || $_SESSION['tipo']==20)

{
    VacasDB::getInstance()->update_habilitado($_SESSION['ubuser']);
}

  VacasDB::getInstance()->update_jefsupl($_SESSION['ubuser']);
  VacasDB::getInstance()->delete_roles($_SESSION['ubuser']);
  VacasDB::getInstance()->delete_sol_suc($_SESSION['ubuser']);
  VacasDB::getInstance()->update_empleado($_SESSION['dni']);
  VacasDB::getInstance()->update_sueldo($_SESSION['dni']);
  VacasDB::getInstance()->update_activ($_SESSION['dni']);
  .....

有谁能告诉我这两个功能我做错了什么?

0 个答案:

没有答案