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


PHP MySQL::execute方法代码示例

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


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

示例1: updatePraiseNum

 public static function updatePraiseNum($pageid)
 {
     $mysql = new MySQL();
     $res = $mysql->execute("update page set praisenum=praisenum+1 where pageid=" . $pageid);
     $mysql->closeCon();
     return $res;
 }
开发者ID:Hank-wood,项目名称:meizizhi,代码行数:7,代码来源:PageService.php

示例2: getSequence

 public static function getSequence($seqType)
 {
     $replace_sql = "replace into sequence(seqname) VALUES('" . $seqType . "')";
     $mysql = new MySQL();
     $mysql->execute($replace_sql);
     $get_sql = "select seq from sequence where seqname='" . $seqType . "'";
     $res = $mysql->executeReturnFirstObj($get_sql);
     $seq = $res['seq'];
     $mysql->closeCon();
     return $seq;
 }
开发者ID:Hank-wood,项目名称:meizizhi,代码行数:11,代码来源:SequenceHelper.php

示例3: explode

<link href="css/main.css" type="text/css" rel="stylesheet" media="screen" /> 
<?php 
require "../config/system.php";
require "../model/Util.php";
require "../model/MySql.php";
$Orden = explode("@", $_POST["Orden"]);
$TurnId = $Orden[0];
$OrdId = $Orden[1];
$tbl_name = $Orden[2];
$_db = new MySQL();
$_db->connect();
$ex = array();
$_sql = "SELECT CASE\r\n\t\t\t    WHEN TestPadrePadre!='' THEN TestPadrePadre\r\n\t\t\t    WHEN TestPadreDescripcion!='' THEN TestPadreDescripcion\r\n\t\t       END AS test\r\n\t\t FROM {$tbl_name} WHERE EstadoProcesa='V' GROUP BY test ORDER BY test ";
$_db->prepare($_sql);
$_result = $_db->execute();
while (@($data = $_db->fetch_array($_result))) {
    $ex[] = $data["test"];
}
$_db->free($_result);
$exams = array_unique($ex);
?>
<div style="margin: 20px">
    <div id="_image">
        <img src="../images/logo_msp.png?>" />&nbsp;<div style="float:right"><h3><?php 
echo CLIENT_NAME;
?>
</h3></div>		
    </div>
    	
    <div id="_header">
		<?php 
开发者ID:atoledov,项目名称:siglab,代码行数:31,代码来源:printer.php

示例4: DetalleOrden

 function DetalleOrden($header, $TurnId, $OrdId, $tbl_name)
 {
     $_db = new MySQL();
     $_db->connect();
     /* Consulto los Examenes - Nuevo Esquema para generar el Menu */
     $ex = array();
     $_sql = "SELECT CASE\r\n\t\t\t\t\tWHEN TestPadrePadre!='' THEN TestPadrePadre\r\n\t\t\t\t\tWHEN TestPadreDescripcion!='' THEN TestPadreDescripcion\r\n\t\t\t\t\tEND AS test\r\n\t\t\t\t FROM {$tbl_name} WHERE EstadoProcesa='V' GROUP BY test ORDER BY test";
     $_db->prepare($_sql);
     //echo $_sql;
     $_result = $_db->execute();
     while (@($data = $_db->fetch_array($_result))) {
         $ex[] = $data["test"];
     }
     $_db->free($_result);
     //Verifico elementos repetidos en el array
     $exams = array_unique($ex);
     /* Barro Todos los Test Padres */
     $np = 0;
     foreach ($exams as $key => $value) {
         // Test Descripcion
         $this->Ln();
         $this->SetFont('Arial', 'B', 10);
         $this->Cell(10, 10, ucwords(strtolower(str_replace(":", " ", $value))), '', 0, 'L', false);
         $this->Ln();
         // Colores, ancho de linea y fuente en negrita
         $this->SetFillColor(101, 101, 101);
         $this->SetTextColor(255);
         $this->SetDrawColor(80, 80, 80);
         $this->SetLineWidth(0.3);
         $this->SetFont('Arial', '', 9);
         // Cabecera
         $w = array(60, 50, 25, 60);
         for ($i = 0; $i < count($header); $i++) {
             $this->Cell($w[$i], 6, $header[$i], 1, 0, 'C', true);
         }
         $this->Ln();
         // Consulto Resultados
         //$this->SetFont('Arial','',9);
         $fill = false;
         $test = trim(str_replace(":", " ", $value));
         $resultados = array();
         $_sql = "SELECT OrdId, OrdTurno, OrdFecha, CONCAT(PacNombre,' ',PacApellido) as Paciente, \r\n\t\t\t\t\t  CONCAT(MedNombre,' ',MedApellido)as Medico, TestDescripcion, Resultado, Unidad, \r\n\t\t\t\t\t  RanValInf, RanValSup, RanMultiple, TestPadre, TestPadreDescripcion, EmpId, EmpDescripcion,\r\n\t\t\t\t\t  TestNivel, TestPadrePadre, '' AS TestPadrePadrePadre, OrdDiagnostico\r\n\t\t\t\t\tFROM `{$tbl_name}` \r\n\t\t\t\t\tWHERE OrdTurno='{$TurnId}' AND OrdId='{$OrdId}' AND EstadoProcesa='V'  \r\n\t\t\t\t\t  AND (TestPadreDescripcion like '%{$test}%' Or TestPadrePadre like '%{$test}%') ";
         if ($test == 'BACTERIOLOGIA') {
             //$_sql .= " ORDER BY TestNivel, TestSubNivel, TestPadreDescripcion ";
             $_sql .= " ORDER BY TestPadre, TestNivel, TestSubNivel ";
         } else {
             if ($test == 'ORINA') {
                 $_sql .= " ORDER BY TestNivel ";
             } else {
                 $_sql .= " ORDER BY TestPadreDescripcion, TestNivel, TestSubNivel ";
             }
         }
         //echo $_sql;
         $_db->prepare($_sql);
         $_result = $_db->execute();
         while (@($data = $_db->fetch_array($_result))) {
             $resultados[] = $data;
         }
         $_db->free($_result);
         /* Muestra los Resultados */
         $i = 1;
         $j = 1;
         $limite = 26;
         foreach ($resultados as $k => $val) {
             $nivel = $val["TestNivel"];
             //Nivel del Examen
             if ($val["TestPadreDescripcion"] != $desc) {
                 $i = 1;
                 //Inicializo i
                 $j = 1;
                 //Inicializo j
             }
             /* Seteo el Formato drl Texto en las cabeceras de los Resultados */
             $this->SetFillColor(255, 255, 255);
             $this->SetTextColor(0);
             $this->SetFont('Arial', 'B', 9);
             if ($nivel > 1) {
                 switch ($nivel) {
                     case "2":
                         if ($i == 1) {
                             $this->Cell($w[0], 6, ucwords(strtolower(str_replace(":", " ", $val["TestPadreDescripcion"]))), '', 0, 'L', false);
                             $this->Ln();
                             //Salto de Linea
                         }
                         $i++;
                         break;
                     case "3":
                         if ($i == 1) {
                             if ($tpp != $val["TestPadrePadre"]) {
                                 $this->Cell($w[0], 6, ucwords(strtolower(str_replace(":", " ", $val["TestPadrePadre"]))), '', 0, 'L', false);
                                 $this->Ln();
                                 //Salto de Linea
                             }
                         }
                         if ($j == 1) {
                             $this->Cell($w[0], 6, ucwords(strtolower(str_replace(":", " ", $val["TestPadreDescripcion"]))), '', 0, 'L', false);
                             $this->Ln();
                             //Salto de Linea
                         }
                         $i++;
//.........这里部分代码省略.........
开发者ID:atoledov,项目名称:siglab,代码行数:101,代码来源:printer_pdf.php

示例5: MySQL

<?php

header("content-type:text/html;charset:utf-8");
require_once 'mysql.class.php';
$mysql = new MySQL('localhost', 'user', 'password', 'test');
echo '<pre>';
//获取表字段
//print_r($mysql->getFields('test'));
//增
echo $mysql->data(array('name' => 'test', 'password' => '123456'))->table('test')->add();
//删
echo $mysql->table('test')->where('id=1')->delete();
//改
echo $mysql->table('test')->data(array('name' => 'bbbbbbbbbbbb'))->where('id<3')->update();
//查
print_r($mysql->table('test')->where('id=4')->select());
print_r($mysql->table('test')->order('id desc')->select());
//
$mysql->query('select * from `test`');
$mysql->execute('update `test` set password = 123');
echo '</pre>';
echo '查询次数:' . $mysql->query_count . '<br>';
echo '查询时间:' . number_format(microtime(true) - $mysql->query_start_time, 10) . ' 秒<br>';
echo '错误信息:' . $mysql->error() . '<br>';
开发者ID:Junred,项目名称:DBclass,代码行数:24,代码来源:mysql.example.php

示例6: generateHeader

 public function generateHeader()
 {
     $_db = new MySQL();
     $_db->connect();
     $_html = "";
     $_sql = "SELECT PacIdentificacion, PacApellido, PacNombre, PacFechaNac, GeneroDescripcion,\r\n                        OrdId, OrdTurno, DATE_FORMAT(OrdFecha, '%d-%m-%Y') AS OrdFecha, MedApellido, \r\n                        MedNombre, SalaHospDescripcion, LabAreaDescripcion, CamaDescripcion,\r\n                        CASE WHEN OrdFechaIngreso!='' AND OrdFechaIngreso!='0000-00-00 00:00:00' THEN \r\n                        DATE_FORMAT(OrdFechaIngreso, '%d-%m-%Y') ELSE '' END AS OrdFechaIngreso\r\n                 FROM {$this->_table}";
     $_db->prepare($_sql);
     $_result = $_db->execute();
     if ($_db->num_rows($_result) > 0) {
         @($data = $_db->fetch_array($_result));
         $this->setOrderId($data["OrdId"]);
         $this->setTurn($data["OrdTurno"]);
         $_html .= "<table width='100%'>";
         $_html .= "<thead>";
         $_html .= "<tr>";
         $_html .= "<td width='15%'>Paciente:</td>";
         $_html .= "<td width='25%'>" . ucwords(strtolower(utf8_encode($data["PacApellido"] . " " . $data["PacNombre"]))) . "</td>";
         $_html .= "<td width='10%'>Sala:</td>";
         $_html .= "<td width='15%'>{$data["SalaHospDescripcion"]}</td>";
         $_html .= "<td width='15%'>An&aacute;isis:</td>";
         $_html .= "<td width='20%'>{$data["OrdTurno"]}</td>";
         $_html .= "</tr>";
         $_html .= "<tr>";
         $_html .= "<td>Fecha Orden:</td>";
         $_html .= "<td>{$data["OrdFecha"]}</td>";
         $_html .= "<td>Cama:</td>";
         $_html .= "<td>{$data["CamaDescripcion"]}</td>";
         $_html .= "<td>CI:</td>";
         $_html .= "<td>{$data["PacIdentificacion"]}</td>";
         $_html .= "</tr>";
         $_html .= "<tr>";
         $_html .= "<td>Fecha Ingreso:</td>";
         $_html .= "<td>{$data["OrdFechaIngreso"]}</td>";
         $_html .= "<td>Area:</td>";
         $_html .= "<td>{$data["LabAreaDescripcion"]}</td>";
         $_html .= "<td>Edad:</td>";
         $_html .= "<td>" . Util::getAge($data["PacFechaNac"]) . " a&ntilde;os</td>";
         $_html .= "</tr>";
         $_html .= "<tr>";
         $_html .= "<td>Medico:</td>";
         $_html .= "<td>" . ucwords(strtolower(utf8_encode($data["MedApellido"] . " " . $data["MedNombre"]))) . "</td>";
         $_html .= "<td></td>";
         $_html .= "<td></td>";
         $_html .= "<td>Sexo:</td>";
         $_html .= "<td>" . ucwords(strtolower($data["GeneroDescripcion"])) . "</td>";
         $_html .= "</tr>";
         $_html .= "</thead>";
         $_html .= "</table>";
     }
     return $_html;
 }
开发者ID:atoledov,项目名称:siglab,代码行数:51,代码来源:Orders.php

示例7: updateShowIndex

 public static function updateShowIndex($pageid, $showIndex)
 {
     $nt = time() * 1000;
     $sql = "update page set  showindex=" . $showIndex . ",udate=" . $nt . " where pageid=" . $pageid;
     $mysql = new MySQL();
     $mysql->execute($sql);
     $mysql->closeCon();
     return true;
 }
开发者ID:Hank-wood,项目名称:meizizhi,代码行数:9,代码来源:ReviewService.php


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