當前位置: 首頁>>代碼示例>>PHP>>正文


PHP database::executeQuery方法代碼示例

本文整理匯總了PHP中database::executeQuery方法的典型用法代碼示例。如果您正苦於以下問題:PHP database::executeQuery方法的具體用法?PHP database::executeQuery怎麽用?PHP database::executeQuery使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在database的用法示例。


在下文中一共展示了database::executeQuery方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: makeLanguageBar

 public function makeLanguageBar($arr, $divider = " | ")
 {
     // make a new connection to the database
     $database = new database($arr);
     $result = $database->executeQuery("SELECT * FROM languages");
     if ($result) {
         $type = null;
         switch ($this->languageType) {
             case 0:
             default:
                 $type = "short";
                 break;
             case 1:
                 $type = "long";
                 break;
             case 2:
                 $type = "flag";
                 break;
         }
         for ($i = 1; $i <= count($result); ++$i) {
             $url = getNewUrl('l', $i);
             if ($i == $this->language) {
                 echo "<strong><a href=\"" . $url . "\">" . $result[$i - 1][$type] . "</a></strong>";
             } else {
                 echo "<a href=\"" . $url . "\">" . $result[$i - 1][$type] . "</a>";
             }
             if ($i < count($result)) {
                 echo $divider;
             }
         }
     } else {
         // make a new connection
         echo "There is a problem with the connection with the database, try again later.<br />";
     }
 }
開發者ID:erwincornelis,項目名稱:Artofyao.com,代碼行數:35,代碼來源:languages.class.php

示例2: GuardarPeriodosSeguimiento

 function GuardarPeriodosSeguimiento()
 {
     $fecha = date("Y-m-d H:i:s");
     $usuario = $_SESSION['session']['user'];
     $plano = $this->idplan;
     $sql = "SELECT * FROM PL_POPERATIVOS_PERIODOS WHERE PK_POPERATIVO = '{$plano}'";
     $numperiodosbase = database::getNumRows($sql);
     $numperiodos = sizeof($this->seguimiento) - 1;
     if ($numperiodosbase > $numperiodos) {
         for ($i = $numperiodos; $i <= $numperiodosbase; $i++) {
             $sql = "DELETE FROM PL_POPERATIVOS_PERIODOS WHERE PK_POPERATIVO = '{$plano}' AND ORDEN='{$i}'";
             database::executeQuery($sql);
         }
     }
     $cont = 1;
     for ($i = 0; $i < sizeof($this->seguimiento) - 1; $i++) {
         $periodo = explode("^", $this->seguimiento[$i]);
         $titulo = $periodo[0];
         $fechai = $periodo[1];
         $fechat = $periodo[2];
         $sql = "SELECT * FROM PL_POPERATIVOS_PERIODOS WHERE PK_POPERATIVO = '{$plano}' AND ORDEN = '{$cont}'";
         $row = database::getRow($sql);
         if ($row) {
             $this->campos = array('PERIODO' => $titulo, 'FECHA_I' => $fechai, 'FECHA_T' => $fechat, 'FECHA_M' => $fecha, 'PK_USUARIO' => $_SESSION['session']['user']);
             $condition = "PK_POPERATIVO = '{$plano}' AND ORDEN = '{$cont}'";
             database::updateRecords("PL_POPERATIVOS_PERIODOS", $this->campos, $condition);
         } else {
             $idperiodo = strtoupper(substr(uniqid('SP'), 0, 15));
             $this->campos = array('PK1' => $idperiodo, 'PERIODO' => $periodo[0], 'ORDEN' => $cont, 'FECHA_I' => $periodo[1], 'FECHA_T' => $periodo[2], 'PK_POPERATIVO' => $this->idplan, 'FECHA_R' => date("Y-m-d H:i:s"), 'FECHA_M' => NULL, 'PK_USUARIO' => $_SESSION['session']['user']);
             database::insertRecords("PL_POPERATIVOS_PERIODOS", $this->campos);
         }
         $cont++;
     }
 }
開發者ID:maroend,項目名稱:protocolos,代碼行數:34,代碼來源:editplano.model.php

示例3: Eliminar

 function Eliminar()
 {
     foreach ($this->ids as $id) {
         $sql = "DELETE FROM RESPONSABLES_CENTRO WHERE PK1 = '{$id}' ";
         $result = database::executeQuery($sql);
     }
 }
開發者ID:maroend,項目名稱:protocolos,代碼行數:7,代碼來源:VerResponsables.model.php

示例4: Eliminar

 function Eliminar()
 {
     foreach ($this->ids as $id) {
         $sql = "DELETE FROM PL_POPERATIVOS_ASIGNACIONES WHERE PK1 = '{$id}' ";
         $result = database::executeQuery($sql);
     }
 }
開發者ID:maroend,項目名稱:protocolos,代碼行數:7,代碼來源:asignaciones.model.php

示例5: ObtenerJerarquias

 function ObtenerJerarquias($id)
 {
     $sql = "SELECT * FROM JERARQUIAS WHERE PADRE = '{$id}' ORDER BY ORDEN";
     $result = database::executeQuery($sql);
     while ($row = mssql_fetch_array($result, MSSQL_ASSOC)) {
         $this->niveles[] = $row;
     }
 }
開發者ID:maroend,項目名稱:protocolos,代碼行數:8,代碼來源:ordenarjerarquia.model.php

示例6: obtenerRoles

 function obtenerRoles()
 {
     $sql = "SELECT * FROM ROLES WHERE TIPO IN('P') ";
     $result = database::executeQuery($sql);
     while ($row = mssql_fetch_array($result, MSSQL_ASSOC)) {
         $this->roles[] = $row;
     }
 }
開發者ID:maroend,項目名稱:protocolos,代碼行數:8,代碼來源:asignarusuario.model.php

示例7: getObjetivosPlan

 function getObjetivosPlan($idlinea)
 {
     $this->objetivos = array();
     $sql = "SELECT * FROM PL_PESTRATEGICOS_OBJETIVOSE WHERE PK_LESTRATEGICA = '{$idlinea}' ORDER BY ORDEN";
     $result = database::executeQuery($sql);
     while ($row = mssql_fetch_array($result, MSSQL_ASSOC)) {
         $this->objetivos[] = $row;
     }
 }
開發者ID:maroend,項目名稱:protocolos,代碼行數:9,代碼來源:uploadPlan.model.php

示例8: getComentarios

 function getComentarios($id)
 {
     $this->comentarios = array();
     $sql = "SELECT * FROM APOYOS_COMENTARIOS WHERE PK_APOYO = '{$id}' ORDER BY FECHA_R DESC";
     $result = database::executeQuery($sql);
     while ($row = mssql_fetch_array($result, MSSQL_ASSOC)) {
         $this->comentarios[] = $row;
     }
 }
開發者ID:maroend,項目名稱:protocolos,代碼行數:9,代碼來源:evidencia.model.php

示例9: getMensajes

 function getMensajes()
 {
     $usuario = $_SESSION['session']['user'];
     $this->mensajes = array();
     $sql = sprintf("SELECT * FROM NOTIFICACIONES WHERE TIPO = 'ALERT' AND PK_USUARIO = '{$usuario}' ORDER BY FECHA_R");
     $result = database::executeQuery($sql);
     while ($r = mssql_fetch_array($result, MSSQL_ASSOC)) {
     }
 }
開發者ID:maroend,項目名稱:protocolos,代碼行數:9,代碼來源:alertas.php

示例10: AgregarNiveles

 function AgregarNiveles()
 {
     $usuario = $this->usuario;
     $sql = "DELETE USUARIOS_JERARQUIA WHERE PK_USUARIO = '{$usuario}'";
     database::executeQuery($sql);
     foreach ($this->niveles as $row) {
         $this->campos = array('PK_USUARIO' => $this->usuario, 'PK_JERARQUIA' => $row);
         database::insertRecords("USUARIOS_JERARQUIA", $this->campos);
     }
 }
開發者ID:maroend,項目名稱:protocolos,代碼行數:10,代碼來源:editinvestigador.model.php

示例11: eliminarMedios

 function eliminarMedios($id)
 {
     $sql = "DELETE FROM PL_POPERATIVOS_MEDIOS WHERE PK_OTACTICO = '{$id}' ";
     $result = database::executeQuery($sql);
     if ($result) {
         //$this->EliminarEvidencias($PK_PLAN);
     } else {
         return FALSE;
     }
 }
開發者ID:maroend,項目名稱:protocolos,代碼行數:10,代碼來源:notificaciones.model.php

示例12: Eliminar

 function Eliminar($id)
 {
     $sql = "DELETE FROM FICHAS WHERE PK1 = '{$id}' ";
     $result = database::executeQuery($sql);
     if ($result) {
         return TRUE;
     } else {
         return FALSE;
     }
 }
開發者ID:maroend,項目名稱:protocolos,代碼行數:10,代碼來源:fichas.model.php

示例13: Eliminar

 function Eliminar($id)
 {
     $sql = "DELETE FROM PROYECTOS WHERE PK1 = '{$id}'";
     $result = database::executeQuery($sql, $params);
     if ($result) {
         //if($this->EliminarRolesUsuario($id)){return TRUE;}else{return FALSE;}
     } else {
         return FALSE;
     }
 }
開發者ID:maroend,項目名稱:protocolos,代碼行數:10,代碼來源:principal.model.php

示例14: EliminarRolesPermisos

 function EliminarRolesPermisos($id)
 {
     $sql = "DELETE FROM ROLES_PERMISOS WHERE PK_ROL = '{$id}' ";
     $result = database::executeQuery($sql);
     if ($result) {
         return TRUE;
     } else {
         return FALSE;
     }
 }
開發者ID:maroend,項目名稱:protocolos,代碼行數:10,代碼來源:rolesadmin.model.php

示例15: getLinks

 function getLinks()
 {
     $this->links = array();
     $sql = "SELECT * FROM LINKS";
     $objdb = new database();
     $result = $objdb->executeQuery($sql);
     while ($row = mysql_fetch_array($result)) {
         $this->links[] = $row;
     }
 }
開發者ID:maroend,項目名稱:protocolos,代碼行數:10,代碼來源:login.model.php


注:本文中的database::executeQuery方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。