当前位置: 首页>>代码示例>>PHP>>正文


PHP dataBaseClass::getCnx方法代码示例

本文整理汇总了PHP中dataBaseClass::getCnx方法的典型用法代码示例。如果您正苦于以下问题:PHP dataBaseClass::getCnx方法的具体用法?PHP dataBaseClass::getCnx怎么用?PHP dataBaseClass::getCnx使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在dataBaseClass的用法示例。


在下文中一共展示了dataBaseClass::getCnx方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: updateTid

 public static function updateTid($id, $data)
 {
     try {
         $sql = "UPDATE tipo_id SET ";
         foreach ($data as $key => $value) {
             $sql = $sql . " " . $key . " = '" . $value . "', ";
         }
         $newLeng = strlen($sql) - 2;
         $sql = substr($sql, 0, $newLeng);
         $sql = $sql . " WHERE cod_tip_id = " . $id;
         dataBaseClass::getCnx()->beginTransaction();
         $rsp = dataBaseClass::getCnx()->exec($sql);
         dataBaseClass::getCnx()->commit();
         if ($rsp !== false) {
             $rsp = true;
         } else {
             throw new PDOException("El tipo de Identificacion {$id} no ha podido ser actualizado");
         }
         return $rsp;
     } catch (PDOException $e) {
         DataBaseClass::getCnx()->rollBack();
         return $e;
     }
 }
开发者ID:Pipe2193,项目名称:Taller2SantaFeAndresFelipeAL,代码行数:24,代码来源:modelClass.php

示例2: updateMatricula

 /**
  *
  * @param type $id
  * @param type $data
  * @return boolean|\PDOException
  * @throws PDOException
  */
 public static function updateMatricula($id, $data)
 {
     try {
         $sql = "UPDATE matricula SET ";
         foreach ($data as $key => $value) {
             $sql = $sql . " " . $key . " = '" . $value . "', ";
         }
         $newLeng = strlen($sql) - 2;
         $sql = substr($sql, 0, $newLeng);
         $sql = $sql . " WHERE num_ficha = " . $id;
         dataBaseClass::getCnx()->beginTransaction();
         $rsp = dataBaseClass::getCnx()->exec($sql);
         dataBaseClass::getCnx()->commit();
         if ($rsp !== false) {
             $rsp = true;
         } else {
             throw new PDOException("La Matricula no ha podido ser actualizado");
         }
         return $rsp;
     } catch (PDOException $e) {
         DataBaseClass::getCnx()->rollBack();
         return $e;
     }
 }
开发者ID:Pipe2193,项目名称:Taller2SantaFeAndresFelipeAL,代码行数:31,代码来源:modelClass.php

示例3: deleteDepto

 /**
  * 
  * @param type $id
  * @return boolean|\PDOException
  * @throws PDOException
  */
 public static function deleteDepto($id)
 {
     try {
         $sql = "DELETE FROM depto WHERE cod_depto = " . $id;
         dataBaseClass::getCnx()->beginTransaction();
         $rsp = dataBaseClass::getCnx()->exec($sql);
         dataBaseClass::getCnx()->commit();
         if ($rsp !== false) {
             $rsp = true;
         } else {
             throw new PDOException("El Departamento no ha podido ser eliminado", 2633);
         }
         return $rsp;
     } catch (PDOException $e) {
         dataBaseClass::getCnx()->rollback();
         return $e;
     }
 }
开发者ID:marianalopezsolarte,项目名称:taller2SantaFeMarianaLopezSolarte,代码行数:24,代码来源:modelClass.php

示例4: deleteCredencial

 /**
  * 
  * @param type $id
  * @return boolean|\PDOException
  * @throws PDOException
  */
 public static function deleteCredencial($id)
 {
     try {
         $sql = "DELETE FROM usuario_credencial WHERE id = " . $id;
         dataBaseClass::getCnx()->beginTransaction();
         $rsp = dataBaseClass::getCnx()->exec($sql);
         dataBaseClass::getCnx()->commit();
         if ($rsp !== false) {
             $rsp = true;
         } else {
             throw new PDOException("El usuario credencial no ha podido ser eliminado", 2633);
         }
         return $rsp;
     } catch (PDOException $e) {
         dataBaseClass::getCnx()->rollback();
         return $e;
     }
 }
开发者ID:Pipe2193,项目名称:Taller2SantaFeAndresFelipeAL,代码行数:24,代码来源:modelClass.php

示例5: updateDatUser

 public static function updateDatUser($id, $data)
 {
     try {
         $sql = "UPDATE Datos_usuario SET ";
         foreach ($data as $key => $value) {
             $sql = $sql . " " . $key . " = '" . $value . "', ";
         }
         $newLeng = strlen($sql) - 2;
         $sql = substr($sql, 0, $newLeng);
         $sql = $sql . " WHERE id = " . $id;
         dataBaseClass::getCnx()->beginTransaction();
         $rsp = dataBaseClass::getCnx()->exec($sql);
         dataBaseClass::getCnx()->commit();
         if ($rsp !== false) {
             $rsp = true;
         } else {
             throw new PDOException("Los Datos Del Usuario no han podido ser actualizado", 2632);
         }
         return $rsp;
     } catch (PDOException $e) {
         DataBaseClass::getCnx()->rollBack();
         return $e;
     }
 }
开发者ID:Pipe2193,项目名称:Taller2SantaFeAndresFelipeAL,代码行数:24,代码来源:modelClass.php

示例6: deleteFicha

 /**
  * 
  * @param type $id
  * @return boolean|\PDOException
  * @throws PDOException
  */
 public static function deleteFicha($id)
 {
     try {
         $sql = "DELETE FROM ficha WHERE num_ficha = " . $id;
         dataBaseClass::getCnx()->beginTransaction();
         $rsp = dataBaseClass::getCnx()->exec($sql);
         dataBaseClass::getCnx()->commit();
         if ($rsp !== false) {
             $rsp = true;
         } else {
             throw new PDOException("La ficha no ha podido ser eliminado", 2633);
         }
         return $rsp;
     } catch (PDOException $e) {
         dataBaseClass::getCnx()->rollback();
         return $e;
     }
 }
开发者ID:marianalopezsolarte,项目名称:taller2SantaFeMarianaLopezSolarte,代码行数:24,代码来源:modelClass.php

示例7: deleteCausaDesercion

 /**
  * 
  * @param type $id
  * @return boolean|\PDOException
  * @throws PDOException
  */
 public static function deleteCausaDesercion($id)
 {
     try {
         $sql = "DELETE FROM causa_desercion WHERE cod_causa = " . $id;
         dataBaseClass::getCnx()->beginTransaction();
         $rsp = dataBaseClass::getCnx()->exec($sql);
         dataBaseClass::getCnx()->commit();
         if ($rsp !== false) {
             $rsp = true;
         } else {
             throw new PDOException("La causa de desercion no ha podido ser ELIMINADA", 2633);
         }
         return $rsp;
     } catch (PDOException $e) {
         dataBaseClass::getCnx()->rollback();
         return $e;
     }
 }
开发者ID:marianalopezsolarte,项目名称:taller2SantaFeMarianaLopezSolarte,代码行数:24,代码来源:modelClass.php


注:本文中的dataBaseClass::getCnx方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。